home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / os2 / ue311gcc.zip / EMACS.TXT < prev    next >
Text File  |  1992-12-29  |  262KB  |  6,172 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.                   MicroEMACS                  MicroEMACS
  17.  
  18.                   Full Screen Text Editor
  19.                   Reference Manual
  20.  
  21.                   Version 3.11
  22.                   October 29, 1991
  23.  
  24.                   (C)Copyright 1988, 1989, 1990, 1991 by Daniel M. Lawrence
  25.                   Reference Manual (C)opyright 1988, 1989, 1990, 1991
  26.                           by Brian Straight and Daniel M. Lawrence
  27.                   All Rights Reserved
  28.  
  29.                   (C)Copyright 1988, 1989, 1990, 1991 by Daniel M. Lawrence                  ____________ _____ _____ _____ ____ __ ______ __ ________
  30.                   MicroEMACS 3.11 can be copied and distributed freely for any                  __________ ____ ___ __ ______ ___ ___________ ______ ___ ___
  31.                   non-commercial purposes. Commercial users may use MicroEMACS                  ______________ _________ __________ _____ ___ ___ __________
  32.                   3.11 inhouse. Shareware distributors may redistribute                  ____ ________ _________ ____________ ___ ____________
  33.                   MicroEMACS 3.11 for media costs only. MicroEMACS 3.11 can only                  __________ ____ ___ _____ _____ _____ __________ ____ ___ ____
  34.                   be incorporated into commercial software or resold with the                  __ ____________ ____ __________ ________ __ ______ ____ ___
  35.                   permission of the current author.                  __________ __ ___ _______ _______
  36.  
  37.  
  38.   Introduction  Introduction
  39.  
  40.           MicroEMACS is a tool for  creating and changing documents, programs, and
  41.   other text files. It is both relatively easy  for  the  novice  to use, but also
  42.   very  powerful  in  the  hands  of  an  expert.  MicroEMACS  can be  extensively
  43.   customized for the needs of the individual user.
  44.  
  45.           MicroEMACS allows  several  files  to  be  edited  at the same time. The
  46.   screen can be split into different  windows  and  screens, and text may be moved
  47.   freely from one window on  any screen to the next. Depending on the type of file
  48.   being edited,  MicroEMACS  can  change  how  it  behaves to make editing simple.
  49.   Editing standard text files, program files and word processing documents are all
  50.   possible at the same time.
  51.  
  52.           There are extensive capabilities to  make  word  processing  and editing
  53.   easier. These include commands for  string  searching  and  replacing, paragraph
  54.   reformatting and deleting, automatic word  wrapping, word move and deletes, easy
  55.   case controlling, and automatic word counts.
  56.  
  57.           For complex and repetitive editing tasks editing macroes can be written.
  58.   These  macroes  allow  the user a great degree of flexibility in determining how
  59.   MicroEMACS  behaves. Also, any and all the commands can be used by any keystroke
  60.   by changing, or rebinding, what commands various keys invoke.
  61.  
  62.           Special  features  are  also  available  to  perform  a diverse  set  of
  63.   operations such  as file encryption, automatic backup file generation, entabbing
  64.   and detabbing lines, executing operating system commands and  filtering  of text
  65.   through other programs (like SORT to allow sorting text).
  66.  
  67.   History  History
  68.  
  69.           EMACS was originally a text editor written by Richard Stallman at MIT in
  70.   the early 1970s for Digital  Equipment computers. Various versions, rewrites and
  71.   clones have made an appearance since.
  72.  
  73.           This version  of  MicroEMACS  is  derived  from  code written by Dave G.
  74.   Conroy in 1985. Later  modifications  were performed by Steve Wilhite and George
  75.   Jones. In December of 1985 Daniel Lawrence picked  up  the  then  current source
  76.   (version  2.0) and made extensive modifications and additions  to  it  over  the
  77.   course of the next six years.  Updates  and  support for the current version are
  78.   still  available.  Commercial  support  and  usage and resale licences are  also
  79.   available. The current program author can be contacted by writing to:
  80.  
  81.           USMAIL: Daniel Lawrence
  82.                   617 New York St
  83.                   Lafayette, IN 47901
  84.  
  85.           UUCP:   pur-ee!mdbs!dan
  86.           ARPA:   mdbs!dan@ee.ecn.purdue.edu
  87.  
  88.           Support is provided through:
  89.  
  90.  
  91.           The Programmer's Room
  92.           Opus 201/10
  93.           300/1200/2400 and 9600 (Hayes V series only)
  94.           (317) 742-5533  no parity  8 databits  no stop bits
  95.  
  96.  
  97.   Credits  Credits
  98.  
  99.           Many people have been involved in creating this software and we  wish to
  100.   credit some of them here. Dave Conroy, of course, wrote  the  very first version
  101.   of MicroEMACS, and it is a credit to his clean coding that so much work was able
  102.   to  be done to expand it. John Gamble is responsible for writing the MAGIC  mode
  103.   search routines, and for maintaining all the search code. Jeff Lomicka wrote the
  104.   appendix on DEC VMS and has supplied a lot of code to support VMS and  the ATARI
  105.   1040ST versions. Curtis Smith wrote the  original  VMS code and help support the
  106.   Commodore AMIGA. Also Lance Jones  has  done  a  lot  of work on the AMIGA code.
  107.   Professor Suresh Konda at Carnegie Mellon University has  put  a  lot  of effort
  108.   into  writing  complex  macros and finding all the bugs in  the  macro  language
  109.   before anyone else does.
  110.  
  111.           A  special  thanks to Dana Hoggatt who  has  provided  an  almost  daily
  112.   sounnding board  for  ideas,  algorithyms  and  code.  He is responcible for the
  113.   encryption code  directly  and  has  prodded  me  into adding many features with
  114.   simple but poignant  questions (Dan? How do we move the upper left corner of the
  115.   screen? . . . which forced me to write the text windowing system).
  116.  
  117.           As to people sending  source  code  and  text translations over computer
  118.   networks  like  USENET and ARPA net, there are simply more than  can  be  listed
  119.   here. [The comments in the edit history in the history.c  file  mention each and
  120.   the piece they contributed]. All these people should  be  thanked  for  the hard
  121.   work they have put into MicroEMACS.
  122.  
  123.  
  124.                                           Daniel M. Lawrence   Basic Concepts                                       MicroEMACS Reference Manual
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.                                      Chapter 1                                     Chapter 1
  132.  
  133.                                    Basic Concepts                                   Basic Concepts
  134.  
  135.  
  136.           The  current  version  of  MicroEMACS  is  3.11  (Third major  re-write,
  137.   eleventh public release), and for the rest of  this  document,  we  shall simply
  138.   refer to this version as "EMACS".  Any  modifications for later versions will be
  139.   in the file README on the MicroEMACS distribution disk.
  140.  
  141.   1.1  Keys and the Keyboard  1.1  Keys and the Keyboard
  142.  
  143.  
  144.           Many times throughout this manual we will be talking about  commands and
  145.   the keys on the keyboard needed to use  them.  There  are  a number of "special"
  146.   keys which can be used and are listed here:
  147.  
  148.   <NL>               NewLine which is also called RETURN, ENTER, or <NL>, this key
  149.                      is used to end different commands.
  150.  
  151.   ^                  The control key  can  be used before any alphabetic character
  152.                      and  some symbols. For example, ^C means  to  hold  down  the
  153.                      <CONTROL> key and type the C key at the same time.
  154.  
  155.   ^X                 The CONTROL-X key is used  at the beginning of many different
  156.                      commands.
  157.  
  158.   META or M-         This is a special EMACS  key used to begin many commands.This
  159.                      key  is  pressed  and then released before  typing  the  next
  160.                      character. On most systems, this is the <ESC> key, but it can
  161.                      be changed. (consult appendix E to learn what key is used for
  162.                      META on your computer).
  163.  
  164.           Whenever  a  command  is described, the  manual  will  list  the  actual
  165.   keystrokes needed to  execute  it  in  boldface using the above conventions, and                                         boldface
  166.   also the name of the command in italics.                                  _______
  167.  
  168.   1.2  Getting Started  1.2  Getting Started
  169.  
  170.  
  171.           In order to use  EMACS,  you  must  call  it  up  from  your  system  or
  172.   computer's command prompt. On UNIX and MSDOS machines, just  type  "emacs"  from
  173.   the command prompt and follow it with the <RETURN> or <ENTER> key (we will refer
  174.   to this key as <NL> for "new-line" for  the  remainder  of  this manual). On the
  175.   Macintosh,  the  Amiga,  the ATARI ST, and  under  OS/2  and  other  icon  based
  176.   operating systems, double click on the uEMACS icon. Shortly after this, a screen
  177.   similar to the one below should appear.
  178.  
  179.  
  180.   1   MicroEMACS Reference Manual                                       Basic Concepts
  181.  
  182.  
  183.   1.3  Parts and Pieces  1.3  Parts and Pieces
  184.  
  185.  
  186.           The screen is divided into a number of areas or windows. On some systems                                                          windows
  187.   the top window contains a function list of unshifted and shifted  function keys.
  188.   We will discuss these keys  later. Below them is an EMACS mode line which, as we                                                            mode line
  189.   will see, informs you of  the  present  mode  of  operation  of  the editor--for
  190.   example  "(WRAP)"  if you set EMACS to wrap at the end of each line.  Under  the
  191.   mode line is the text window where text appears and  is  manipulated. Since each                   text window
  192.   window has its own mode  line, below the text window is it's mode line. The last
  193.   line of the screen is the command line where EMACS takes commands and reports on                            command line
  194.   what it is doing.
  195.  
  196.   ===============================================================================
  197.   f1 search-> f2 <-search |    MicroEMACS:  Text Editor
  198.   f3 hunt->   f4 <-hunt   |
  199.   f5 fkeys    f6 help     |  Available function key Pages include:
  200.   f7 nxt wind f8 pg[    ] |    WORD  BOX  EMACS  PASCAL  C  cObal  Lisp
  201.   f9 save     f10 exit    |  [use the f8 key to load Pages]
  202.   ===============================================================================
  203.      MicroEMACS 3.11 ()    Function Keys
  204.   ===============================================================================
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.   ===============================================================================
  217.   ---- MicroEMACS 3.11 () -- Main ----------------------------------------------
  218.   ===============================================================================
  219.                   Fig 1:  EMACS screen on an IBM-PC
  220.  
  221.   1.4  Entering Text  1.4  Entering Text
  222.  
  223.  
  224.           Entering text in EMACS is simple. Type the following sentence fragment:
  225.  
  226.        Fang Rock lighthouse, center of a series of mysterious and
  227.  
  228.   The text is displayed at the top of the text window. Now type:
  229.  
  230.        terrifying events at the turn of the century
  231.  
  232.           Notice that some of your text has dissapeared off the  left  side of the
  233.   screen.  Don't panic--your text is safe!!! You've  just  discovered  that  EMACS
  234.  
  235.  
  236.                                                                                  2   Basic Concepts                                       MicroEMACS Reference Manual
  237.  
  238.  
  239.   doesn't "wrap" text to the next  line  like  most word processors unless you hit
  240.   <NL>. But since EMACS is used for both word processing, and text editing, it has
  241.   a bit of a dual  personality. You can change the way it works by setting various
  242.   modes.  In this case, you need to set WRAP mode, using the add-mode command,  by  modes                                 WRAP                 ________
  243.   typing ^XM. The  command  line at the base of the screen will prompt you for the         ^XM
  244.   mode you wish to add. Type wrap followed by the <NL> key and  any  text  you now                             wrap
  245.   enter will be wrapped.  However,  the command doesn't wrap text already entered.
  246.   To get rid  of  the long line, press and hold down the <BACKSPACE> key until the
  247.   line  is  gone.  Now type in the words you deleted, watch how EMACS goes down to
  248.   the next line  at  the right time. (In some versions of EMACS, WRAP is a default                                     ___ ____ ________ __ ______ WRAP __ _ _______                                                                 ____
  249.   mode in which case you don't  have  to  worry about the instructions relating to  ____ __ _____ ____ ___ _____  ____  __  _____ _____ ___ ____________ ________ __
  250.   adding this mode.)  ______ ____ ______
  251.  
  252.           Now  let's type a longer insert. Hit <NL> a couple of times to tab  down
  253.   from the text you just entered. Now type the following  paragraphs.   Press <NL>
  254.   twice to indicate a paragraph break.
  255.  
  256.        Fang Rock lighthouse, center of  a series of mysterious and terrifying
  257.        events at the turn of the century, is built on a  rocky  island  a few
  258.        miles of the Channel coast. So  small  is the island that wherever you
  259.        stand its rocks are wet with sea spray.
  260.  
  261.        The lighthouse tower is in the center of the island. A steep flight of
  262.        steps leads to the heavy door in its base. Winding  stairs  lead up to
  263.        the crew room.
  264.  
  265.   1.5  Basic cursor movement  1.5  Basic cursor movement
  266.  
  267.  
  268.           Now let's practice moving around in  this  text. To move the cursor back
  269.   to the word "Winding," enter M-B previous-word. This command  moves  the  cursor                               M-B _____________
  270.   backwards by one word at  a  time.  Note  you  have to press the key combination
  271.   every time the cursor steps back by one  word.  Continuously  pressing  META and
  272.   toggling B produces an error message. To move forward to the word "stairs" enter
  273.   M-F next-word, which moves the cursor forward by one word at a time.  M-F _________
  274.  
  275.           Notice  that  EMACS  commands are usually mnemonic--F for forward, B for
  276.   backward, for example.
  277.  
  278.           To move the cursor up one line, enter ^P previous-line, down one line ^N                                                ^P _____________                ^N
  279.   next-line. Practice this movement by moving the cursor to the  word "terrifying"  _________
  280.   in the second line.
  281.  
  282.           The cursor may also be moved forward or backward in  smaller increments.
  283.   To move forward by one character, enter ^F forward-character, to  move backward,                                          ^F _________________
  284.   ^B  backward-character.  EMACS also allows you to  specify  a  number  which  is  ^B  __________________
  285.   normally  used to tell a command to execute many times. To repeat most commands,
  286.   press META and then the number before you enter the  command.  Thus, the command
  287.   META 5 ^F (M-5^F) will move  the  cursor  forward by five characters. Try moving             M-5^F
  288.   around in the text by using  these  commands.  For extra practice, see how close
  289.  
  290.  
  291.  
  292.   3   MicroEMACS Reference Manual                                       Basic Concepts
  293.  
  294.  
  295.   you can come to the word "small" in the first paragraph by giving an argument to
  296.   the commands listed here.
  297.  
  298.           Two other simple cursor commands that are useful to help us  move around
  299.   in  the  text  are M-N next-paragraph which  moves  the  cursor  to  the  second                     M-N ______________
  300.   paragraph, and M-P  previous-paragraph  which  moves  it  back  to  the previous                 M-P  __________________
  301.   paragraph. The cursor may also  be moved rapidly from one end of the line to the
  302.   other. Move the cursor to the word "few" in the second line. Press ^A beginning-                                                                     ^A __________
  303.   of-line. Notice the cursor moves to  the  word  "events" at the beginning of the  _______
  304.   line. Pressing ^E end-of-line moves the cursor to the end of the line.                 ^E ___________
  305.  
  306.           Finally,  the cursor may be moved from any point in the file to the  end
  307.   or beginning of the file. Entering M-> end-of-file moves the  cursor  to the end                                     M-> ___________
  308.   of the buffer, M-< beginning-of-file to the first character of the file.                 M-< _________________
  309.  
  310.           On the IBM-PC, the ATARI ST and many other machines, the cursor keys can          __ ___ _______ ___ _____ __ ___ ____ _____ _________ ___ ______ ____ ___
  311.   also be used to move the cursor.  ____ __ ____ __ ____ ___ _______
  312.  
  313.           Practice moving the cursor in the text until you  are  comfortable  with
  314.   the commands we've explored in this chapter.
  315.  
  316.   1.6  Saving your text  1.6  Saving your text
  317.  
  318.  
  319.           When you've finished practicing  cursor  movement,  save your file. Your
  320.   file currently resides in a BUFFER. The buffer is a  temporary  storage area for                              BUFFER
  321.   your text, and is lost  when the computer is turned off. You can save the buffer
  322.   to a file by entering ^X^S  save-file.  Notice  that EMACS informs you that your                        ^X^S  _________
  323.   file has no name and will not let you save it.
  324.  
  325.           To save your buffer to a  file  with  a different name than it's current
  326.   one  (which  is empty), press ^X^W write-file.  EMACS will prompt  you  for  the                                ^X^W __________
  327.   filename you wish to write. Enter the  name  fang.txt  and  press  return.  On a                                               fang.txt
  328.   micro, the drive light will come on, and EMACS will inform you it is writing the
  329.   file. When it finishes, it will inform you of the number of lines it has written
  330.   to the disk.
  331.  
  332.           Congratulations!! You've just saved your first EMACS file!
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.                                                                                  4   Basic Concepts                                       MicroEMACS Reference Manual
  349.  
  350.  
  351.  
  352.  
  353.                                  Chapter 1 Summary                                 Chapter 1 Summary
  354.  
  355.           In  chapter 1, you learned how to enter text, how to use wrap mode,  how
  356.   to move the cursor, and to save a  buffer.  The  following  is  a  table  of the
  357.   commands covered in this chapter and their corresponding key bindings:
  358.  
  359.   Key Binding             Keystroke       Effect  ___ _______             _________       ______
  360.  
  361.   abort-command           ^G              aborts current command                          ^G
  362.  
  363.   add-mode                ^XM             allows addition of EMACS                          ^XM
  364.                                           mode such as WRAP                                                       WRAP
  365.  
  366.   backward-character      ^B              moves cursor left one character                          ^B
  367.  
  368.   beginning-of-file       M-<             moves cursor to beginning of file                          M-<
  369.  
  370.   beginning-of-line       ^A              moves cursor to beginning of line                          ^A
  371.  
  372.   end-of-file             M->             moves cursor to end of file                          M->
  373.  
  374.   end-of-line             ^E              moves cursor to end of line                          ^E
  375.  
  376.   forward-character       ^F              moves cursor right one character                          ^F
  377.  
  378.   next-line               ^N              moves cursor to next line                          ^N
  379.  
  380.   next-paragraph          M-N             moves cursor to next paragraph                          M-N
  381.  
  382.   next-word               M-F             moves cursor forward one word                          M-F
  383.  
  384.   previous-line           ^P              moves cursor backward by one line                          ^P
  385.  
  386.   previous-paragraph      M-P             moves cursor to previous paragraph                          M-P
  387.  
  388.   previous-word           M-B             moves cursor backward by one word                          M-B
  389.  
  390.   save-file               ^X^S            saves current buffer to a file                          ^X^S
  391.  
  392.   write-file              ^X^W            save current buffer under a new name                          ^X^W
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.   5   MicroEMACS Reference Manual       Basic Editing--Simple Insertions and Deletions
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.                                      Chapter 2                                     Chapter 2
  412.  
  413.                    Basic Editing--Simple Insertions and Deletions                   Basic Editing--Simple Insertions and Deletions
  414.  
  415.  
  416.   2.1  A Word About Windows, Buffers, Screens, and Modes  2.1  A Word About Windows, Buffers, Screens, and Modes
  417.  
  418.  
  419.           In the first chapter, you learned how  to  create  and  save  a  file in
  420.   EMACS. Let's do  some  more editing on this file. Call up emacs by typing in the
  421.   following command.
  422.  
  423.           emacs fang.txt          emacs fang.txt
  424.  
  425.           On icon oriented  systems,  double  click  on the uEMACS icon, usually a          __ ____ ________  ________  ______  _____  __ ___ ______ _____ _______ _
  426.   file dialog box of some sort  will  appear. Choose FANG.TXT from the appropriate  ____ ______ ___ __ ____ ____  ____  _______ ______ FANG.TXT ____ ___ ___________                                                     ________
  427.   folder.  _______
  428.  
  429.           Shortly after you  invoke  EMACS,  the  text should appear on the screen
  430.   ready  for  you  to  edit.  The text you are looking at currently resides  in  a
  431.   buffer. A  buffer  is  a  temporary area of computer memory which is the primary  buffer
  432.   unit internal to  EMACS  -- this is the place where EMACS goes to work. The mode
  433.   line at the bottom of the screen lists the buffer name, FANG.TXT and the name of                                                          FANG.TXT
  434.   the file with which this buffer is associated, FANG.TXT                                                 FANG.TXT
  435.  
  436.           The computer talks to you through the use  of  its  screen.  This screen                                                              screen
  437.   usually has an area of  24 lines each of 80 characters across. You can use EMACS
  438.   to  subdivide  the  screen into several separate work areas, or windows, each of                                                                  windows
  439.   which can be 'looking into' different files or sections of text.  Using windows,
  440.   you can work  on several related texts at one time, copying and moving blocks of
  441.   text  between  windows with ease. To keep track of what you  are  editing,  each
  442.   window is identified  by  a mode line on the last line of the window which lists                              mode line
  443.   the  name  of  the buffer which it is looking into, the file from which the text                     buffer
  444.   was read, and how the text is being edited.
  445.  
  446.           An EMACS mode  tells  EMACS  how  to  deal  with  user input. As we have                   mode
  447.   already  seen,  the  mode 'WRAP' controls how EMACS deals with long lines (lines
  448.   with  over  79 characters) while the user is typing them in.  The  'VIEW'  mode,
  449.   allows you to read a  file  without  modifying  it.  Modes  are  associated with
  450.   buffers and not  with files; hence, a mode needs to be explicitly set or removed
  451.   every  time you edit a file. A new file read into a  buffer  with  a  previously
  452.   specified  mode  will  be  edited  under  this  mode. If you use specific  modes
  453.   frequently, EMACS allows you to set the modes which are used by all new buffers,
  454.   called global modes.         global
  455.  
  456.  
  457.  
  458.  
  459.  
  460.                                                                                  6   Basic Editing--Simple Insertions and Deletions       MicroEMACS Reference Manual
  461.  
  462.  
  463.   2.2  Insertions  2.2  Insertions
  464.  
  465.  
  466.           Your previously-saved text should look like this:
  467.  
  468.        Fang Rock lighthouse, center of  a series of mysterious and terrifying
  469.        events at the turn of the century, is built on a  rocky  island  a few
  470.        miles of the Channel coast. So  small  is the island that wherever you
  471.        stand its rocks are wet with sea spray.
  472.  
  473.        The lighthouse tower is in the center of the island. A steep flight of
  474.        steps leads to the heavy door in its base. Winding  stairs  lead up to
  475.        the crew room.
  476.  
  477.           Let's  assume  you  want to add a sentence in the second paragraph after
  478.   the word "base."  Move the cursor until it is on the "W" of "Winding".  Now type
  479.   the following:
  480.  
  481.        This  gives entry to the lower floor where  the  big  steam  generator
  482.        throbs steadily away, providing power for the electric lantern.
  483.  
  484.           If the line fails to wrap and you end up with a '$'  sign  in  the right
  485.   margin, just enter  M-Q  fill-paragraph  to  reformat  the  paragraph.  This new                      M-Q  ______________
  486.   command attempts to fill out a paragraph. Long lines are  divided  up, and words
  487.   are shuffled around to make the paragraph look nicer.
  488.  
  489.           Notice that all visible EMACS characters are self-inserting  --  all you
  490.   had to do was type the characters to insert and the existing text made space for
  491.   it. With a few exceptions discussed later, all non-printing characters  (such as
  492.   control  or escape sequences) are commands. To insert  spaces,  simply  use  the
  493.   space bar. Now move to the first line of the file and type ^O open-line (Oh, not                                                             ^O _________
  494.   zero).  You've just learned how to insert a blank line in your text.
  495.  
  496.   2.3  Deletions  2.3  Deletions
  497.  
  498.  
  499.           EMACS offers a number of deletion options. For example, move  the cursor
  500.   until it's under the period at the end of the insertion you just did.  Press the
  501.   backspace  key.  Notice   the   "n"  on  "lantern"  disappeared.  The  backspace
  502.   implemented  on  EMACS  is  called  a  destructive  backspace--it  removes  text                                         destructive
  503.   immediately  before the current cursor position from the  buffer.  Now  type  ^H                                                                                ^H
  504.   delete-previous-character. Notice that the cursor moves back and obliterates the  _________________________
  505.   "r"--either command will backspace the cursor.
  506.  
  507.           Type in  the  two  letters  you erased to restore your text and move the
  508.   cursor to the  beginning  of  the  buffer M-> beginning-of-file. Move the cursor                                            M-> _________________
  509.   down one line to the beginning of the first paragraph.
  510.  
  511.           To delete  the forward character, type ^D delete-next-character. The "F"                                                 ^D _____________________
  512.   of "Fang" disappears. Continue to type ^D until the whole  word  is erased EMACS                                         ^D
  513.   also permits  the  deletion  of  larger elements of text. Move the cursor to the
  514.  
  515.  
  516.   7   MicroEMACS Reference Manual       Basic Editing--Simple Insertions and Deletions
  517.  
  518.  
  519.   word "center" in the first line of text. Pressing M-<backspace> delete-previous-                                                    M-<backspace> ________________
  520.   word kills the word immediately before the cursor. M-^H has the same effect.  ____                                               M-^H
  521.  
  522.           Notice that the commands are very similar to the  control  commands  you
  523.   used to delete individual letters. As a general rule in EMACS, control sequences
  524.   affect small areas of text, META sequences larger areas. The word forward of the
  525.   cursor position can therefore  be  deleted  by  typing M-D delete-next-word. Now                                                         M-D ________________
  526.   let's take out the remainder of the first line by typing ^K kill-to-end-of-line.                                                           ^K ___________________
  527.   You now have a blank line at the top of your screen.  Typing  ^K  again  or ^X^O                                                                ^K            ^X^O
  528.   delete-blank-lines deletes the blank line and flushes the second line to the top  __________________
  529.   of  the text. Now exit EMACS by typing ^X^C exit-emacs. Notice EMACS reminds you                                         ^X^C __________
  530.   that  you have not saved your buffer. Ignore the warning and exit. This way  you
  531.   can exit EMACS without saving any of the changes you just made.
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.                                                                                  8   Basic Editing--Simple Insertions and Deletions       MicroEMACS Reference Manual
  573.  
  574.  
  575.  
  576.  
  577.                                  Chapter 2 Summary                                 Chapter 2 Summary
  578.  
  579.           In Chapter 2, you learned about the basic 'building blocks' of  an EMACS
  580.   text file--buffers, windows, and files.
  581.  
  582.   Key binding             Keystroke       Effect  ___ _______             _________       ______
  583.   delete-previous-character
  584.                           ^H              deletes character immediately before                          ^H
  585.                                           the current cursor position
  586.  
  587.   delete-next-character   ^D              deletes character immediately after                          ^D
  588.                                           current cursor position
  589.  
  590.   delete-previous-word    M-^H            deletes word immediately before                          M-^H
  591.                                           current cursor position
  592.  
  593.   delete-next-word        M-D             deletes word immediately after                          M-D
  594.                                           current cursor position
  595.  
  596.   kill-to-end-of-line     ^K              deletes from current cursor                          ^K
  597.                                           position to end of line
  598.  
  599.   insert-space            ^C              inserts a space to right of cursor                          ^C
  600.  
  601.   open-line               ^O              inserts blank line                          ^O
  602.  
  603.   delete-blank-lines      ^X^O            removes blank line                          ^X^O
  604.  
  605.   exit-emacs              ^X^C            exits emacs                          ^X^C
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.   9   MicroEMACS Reference Manual                                        Using Regions
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.                                      Chapter 3                                     Chapter 3
  636.  
  637.                                    Using Regions                                   Using Regions
  638.  
  639.  
  640.   3.1  Defining and Deleting a Region  3.1  Defining and Deleting a Region
  641.  
  642.  
  643.           At  this point its time to familiarize ourselves  with  two  more  EMACS
  644.   terms--the point and the mark. The point is located directly behind  the current             point         mark
  645.   cursor position. The mark (as we shall see shortly) is  user  defined. These two
  646.   elements  together are called the current region and limit the region of text on                                            region               region
  647.   which EMACS performs many of its editing functions.
  648.  
  649.           Let's  begin by entering some new text. Don't forget to add wrap mode if                                                                      wrap
  650.   its not set on this buffer. Start EMACS and open a file called PUBLISH.TXT. Type                                                                 PUBLISH.TXT
  651.   in the following text:
  652.  
  653.        One  of  the  largest growth areas in personal computing is electronic
  654.        publishing. There are packages available for practically every machine
  655.        from  elegantly  simple  programs  for  the  humble  Commodore  64  to
  656.        sophisticated professional packages for PC and Macintosh computers.
  657.  
  658.        Electronic publishing is as revolutionary  in its way as the Gutenburg
  659.        press.  Whereas the printing press allowed  the  mass  production  and
  660.        distribution of the written word, electronic publishing puts the means
  661.        of production in the hands of nearly every individual. From  the class
  662.        magazine to the corporate report,  electronic  publishing  is changing
  663.        the way we produce and disseminate information.
  664.  
  665.        Personal publishing greatly increases the utility of practically every
  666.        computer. Thousands of people  who  joined  the computer revolution of
  667.        this  decade  only  to hide their  machines  unused  in  closets  have
  668.        discovered a new use for them as dedicated publishing workstations.
  669.  
  670.           Now let's do  some  editing.  The  last  paragraph seems a little out of
  671.   place.  To  see what the document looks like without it we can cut it  from  the
  672.   text by moving the cursor to  the  beginning  of the paragraph.  Enter M-<space>                                                                         M-<space>
  673.   set-mark. EMACS will respond with "[Mark set]". Now move the  cursor  to the end  ________
  674.   of the paragraph.    You have just defined a region of text. To remove this text
  675.   from the screen, type ^W kill-region. The paragraph disappears from the screen.                        ^W ___________
  676.  
  677.           On further consideration,  however,  perhaps the paragraph we cut wasn't
  678.   so bad after  all.  The problem may have been one of placement. If we could tack
  679.   it on to the end of the first paragraph it might work quite well to  support and
  680.   strengthen the argument. Move the cursor to the end of  the  first paragraph and
  681.   enter ^Y yank. Your text should now look like this:        ^Y ____
  682.  
  683.  
  684.                                                                                 10   Using Regions                                        MicroEMACS Reference Manual
  685.  
  686.  
  687.        One  of  the  largest growth areas in personal computing is electronic
  688.        publishing. There are packages available for practically every machine
  689.        from  elegantly  simple  programs  for  the  humble  Commodore  64  to
  690.        sophisticated professional packages for  PC  and  Macintosh computers.
  691.        Personal publishing greatly increases the utility of practically every
  692.        computer. Thousands of people  who  joined  the computer revolution of
  693.        this  decade  only  to hide their  machines  unused  in  closets  have
  694.        discovered a new use for them as dedicated publishing workstations.
  695.  
  696.        Electronic publishing is as revolutionary  in its way as the Gutenburg
  697.        press.  Whereas the printing press allowed  the  mass  production  and
  698.        distribution of the written word, electronic publishing puts the means
  699.        of production in the hands of nearly every individual. From  the class
  700.        magazine to the corporate report,  electronic  publishing  is changing
  701.        the way we produce and disseminate information.
  702.  
  703.   3.2  Yanking a Region  3.2  Yanking a Region
  704.  
  705.  
  706.           The text you cut initially didn't simply just disappear, it was cut into
  707.   a buffer that retains the 'killed' text appropriately called the kill buffer. ^Y                                                                   kill buffer  ^Y
  708.   "yanks" the text back from this buffer into the current buffer.  If  you  have a
  709.   long line (indicated, remember, by the "$" sign), simply hit M-Q to reformat the                                                               M-Q
  710.   paragraph.
  711.  
  712.           There  are  other uses to which the kill buffer can be  put.  Using  the
  713.   method we've already learned, define the last paragraph as a region. Now type M-                                                                                M-
  714.   W copy-region. Nothing seems to have happened; the cursor stays blinking  at the  W ___________
  715.   point. But  things  have  changed,  even  though  you may not be able to see any
  716.   alteration.
  717.  
  718.           To see what has happened to  the  contents  of the kill buffer, move the
  719.   cursor down a couple of lines and "yank" the contents of  the  kill  buffer back
  720.   with ^Y. Notice the last paragraph  is  now  repeated. The region you defined is       ^Y
  721.   "tacked  on" to the end of your file because M-W copies a  region  to  the  kill                                               M-W copies
  722.   buffer while leaving the original text  in  your working buffer. Some caution is
  723.   needed however, because the contents of the kill  buffer  are  updated  when you
  724.   delete  any regions, lines or words. If you are moving large quantities of text,
  725.   complete the operation before you do any more deletions or  you  could find that
  726.   the  text  you  want  to  move  has been replaced by the most  recent  deletion.
  727.   Remember--a  buffer is a temporary area of computer memory that is lost when the
  728.   machine is  powered  down  or  switched  off.  In  order  to  make  your changes
  729.   permanent, they must be saved to a file before you leave EMACS. Let's delete the
  730.   section of text we just added and save the file to disk.
  731.  
  732.  
  733.                                  Chapter 3 Summary                                 Chapter 3 Summary
  734.  
  735.           In  Chapter  3,  you  learned  how  to  achieve  longer  insertions  and
  736.   deletions. The EMACS terms point and mark were introduced and you learned how to                             point     mark
  737.   manipulate text with the kill buffer.
  738.  
  739.  
  740.   11   MicroEMACS Reference Manual                                        Using Regions
  741.  
  742.  
  743.   Key Binding     Keystroke       Effect  ___ _______     _________       ______
  744.  
  745.   set-mark        M-<space>       Marks the beginning of a region                  M-<space>
  746.  
  747.   delete-region   ^W              Deletes region between point and mark and                  ^W
  748.                                   places it in KILL buffer
  749.  
  750.   copy-region     M-W             Copies text between point and mark into                  M-W
  751.                                   KILL buffer
  752.  
  753.   yank-text       ^Y              Inserts a copy of the KILL buffer into                  ^Y
  754.                                   current buffer at point
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.                                                                                 12   Search and Replace                                   MicroEMACS Reference Manual
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.                                      Chapter 4                                     Chapter 4
  804.  
  805.                                  Search and Replace                                 Search and Replace
  806.  
  807.  
  808.   4.1  Forward Search  4.1  Forward Search
  809.  
  810.  
  811.           Load EMACS and bring in the file you just saved.  Your  file should look
  812.   like the one below.
  813.  
  814.        One  of  the  largest growth areas in personal computing is electronic
  815.        publishing. There are packages available for practically every machine
  816.        from  elegantly  simple  programs  for  the  humble  Commodore  64  to
  817.        sophisticated professional packages for  PC  and  Macintosh computers.
  818.        Personal publishing greatly increases the utility of practically every
  819.        computer. Thousands of people  who  joined  the computer revolution of
  820.        this  decade  only  to hide their  machines  unused  in  closets  have
  821.        discovered a new use for them as dedicated publishing workstations.
  822.  
  823.        Electronic publishing is as revolutionary  in its way as the Gutenburg
  824.        press.  Whereas the printing press allowed  the  mass  production  and
  825.        distribution of the written word, electronic publishing puts the means
  826.        of production in the hands of nearly every individual. From  the class
  827.        magazine to the corporate report,  electronic  publishing  is changing
  828.        the way we produce and disseminate information.
  829.  
  830.           Let's use EMACS  to  search  for  the word "revolutionary" in the second
  831.   paragraph.  Because  EMACS  searches from the current cursor position toward the
  832.   end  of  buffers,  and we intend to search  forward,  move  the  cursor  to  the
  833.   beginning of the text. Enter ^S  search-forward.  Note that the command line now                               ^S  ______________
  834.   reads
  835.  
  836.           "Search [] <META>:"
  837.  
  838.           EMACS is prompting you to enter the search string --  the  text you want                                              search string
  839.   to find. Enter  the word revolutionary and hit the META key. The cursor moves to                           revolutionary             META
  840.   the end of the word "revolutionary."
  841.  
  842.           Notice that you must enter the  <META>  key  to start the search. If you
  843.   simply press <NL> the command line responds with "<NL>".  Although this may seem
  844.   infuriating  to  users who are used to pressing the return key  to  execute  any
  845.   command,  EMACS' use of <META> to begin searches allows it to pinpoint text with
  846.   great accuracy. After every line wrap or carriage  return,  EMACS  'sees'  a new
  847.   line character (<NL>).  If you need to search for  a  word at the end of a line,
  848.   you can specify this word uniquely in EMACS.
  849.  
  850.  
  851.  
  852.   13   MicroEMACS Reference Manual                                   Search and Replace
  853.  
  854.  
  855.           In our sample text for example, the word "and" occurs a number of times,
  856.   but only once at the  end of a line. To search for this particular occurrence of
  857.   the word, move the cursor to the beginning  of  the  buffer  and type ^S. Notice                                                                        ^S
  858.   that EMACS stores the last specified search string as the default string. If you                                                            default
  859.   press <META> now, EMACS will  search  for  the  default  string,  in  this case,        <META>
  860.   "revolutionary."
  861.  
  862.           To  change  this  string so we can search for our specified "and" simply
  863.   enter the word and followed by <NL>. The command line now shows:                 and             <NL>
  864.  
  865.           "search [and<NL>]<META>:"
  866.  
  867.           Press <META> and the cursor moves to "and" at the end of the second last                <META>
  868.   line.
  869.  
  870.   4.2  Exact Searches  4.2  Exact Searches
  871.  
  872.  
  873.           If the mode EXACT is active in the current buffer,  EMACS  searches on a
  874.   case sensitive  basis.  Thus,  for  example  you  could search for Publishing as                                                                     Publishing
  875.   distinct from publishing.                publishing
  876.  
  877.  
  878.   4.3  Backward Search  4.3  Backward Search
  879.  
  880.  
  881.           Backward searching is very similar to forward searching  except  that it
  882.   is implemented in the reverse direction. To implement a reverse search,  type ^R                                                                                ^R
  883.   search-reverse. Because  EMACS makes no distinction between forward and backward  ______________
  884.   stored search strings, the last search  item  you entered appears as the default
  885.   string. Try  searching  back  for  any word that lies between the cursor and the
  886.   beginning of the  buffer. Notice that when the item is found, the point moves to
  887.   the beginning of  the  found  string  (i.e.,  the cursor appears under the first
  888.   letter of the search item).
  889.  
  890.           Practice searching for other words in your text.
  891.  
  892.   4.4  Searching and Replacing  4.4  Searching and Replacing
  893.  
  894.  
  895.           Searching and replacing is a powerful and quick way of making changes to
  896.   your text. Our sample text is about electronic publishing, but the  correct term
  897.   is  'desktop'  publishing.  To make the necessary changes we need to replace all
  898.   occurrences of the word  "electronic"  with "desktop." First, move the cursor to
  899.   the top of the current buffer with the M-< command. Then type M-R replace-string                                         M-<                    M-R ______________
  900.     The command line responds:
  901.  
  902.           "Replace []<META>:"
  903.  
  904.           where  the square brackets enclose the default  string.  Type  the  word
  905.   electronic and hit <META>. The command line responds:  electronic         <META>
  906.  
  907.  
  908.                                                                                 14   Search and Replace                                   MicroEMACS Reference Manual
  909.  
  910.  
  911.           "with []<META>"
  912.  
  913.           type desktop<META>. EMACS replaces  all  instances  of the original word               desktop<META>
  914.   with your revision. Of course, you will have to capitalize  the  first letter of
  915.   "desktop" where it occurs at the beginning of a sentence.
  916.  
  917.           You have just completed an  unconditional  replace.  In  this operation,                                      unconditional  replace
  918.   EMACS replaces every instance of the found string with the replacement string.
  919.  
  920.   4.5  Query-Replace  4.5  Query-Replace
  921.  
  922.  
  923.           You may also replace text on a  case  by  case  basis.  The  M-^R query-                                                                       M-^R ______
  924.   replace-string command  causes  EMACS  to  pause  at  each instance of the found  ______________
  925.   string.
  926.  
  927.           For  example,  assume we want to replace  some  instances  of  the  word
  928.   "desktop" with the  word  "personal."  Go  back  to the beginning of the current
  929.   buffer and enter the  M-^R  query-replace command. The procedure is very similar                        M-^R  _____________
  930.   to that which you followed in the unconditional search/replace option.  When the
  931.   search begins however, you will notice that EMACS  pauses  at  each  instance of
  932.   "publishing"  and  asks whether you wish to  replace  it  with  the  replacement
  933.   string. You have a number of options available for response:
  934.  
  935.           Response        Effect          ________        ______
  936.           Y(es)   Make the current replacement and skip to the next
  937.                   occurrence of the search string
  938.  
  939.           N(o)    Do not make this replacement but continue
  940.  
  941.           !       Do the rest of the replacements with no more queries
  942.  
  943.           U(ndo)  Undo just the last replacement and query for it
  944.                   again (This can only go back ONE time)
  945.  
  946.           ^G      Abort the replacement command (This action does not
  947.                   undo previously-authorized replacements
  948.  
  949.           . Same effect as ^G, but cursor returns to the point at
  950.                   which the replacement command was given
  951.  
  952.           ?       This lists help for the query replacement command
  953.  
  954.           Practice  searching  and  searching  and   replacing   until   you  feel
  955.   comfortable with the commands and their effects.
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.   15   MicroEMACS Reference Manual                                   Search and Replace
  965.  
  966.  
  967.                                  Chapter 4 Summary                                 Chapter 4 Summary
  968.  
  969.           In this chapter, you learned how to search for specified strings of text
  970.   in EMACS.  The  chapter  also  dealt  with  searching for and replacing elements
  971.   within a buffer.
  972.  
  973.   Key Binding             Keystroke                        Effect  ___ _______             _________                        ______
  974.  
  975.   search-forward          ^S      Searches from point to end of buffer.                          ^S
  976.                                   Point is moved from current location to
  977.                                   the end of the found string
  978.  
  979.   search-backward         ^R      Searches from point to beginning of buffer.                          ^R
  980.                                   Point is moved from current location to
  981.                                   beginning of found string
  982.  
  983.   replace                 M-R Replace ALL occurrences of search string with                          M-R
  984.                                   specified (null) string from point to the
  985.                                   end of the current buffer
  986.  
  987.   query-replace          M-^R As above, but pause at each found string                         M-^R
  988.                                   and query for action
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.                                                                                 16   Windows                                              MicroEMACS Reference Manual
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.                                      Chapter 5                                     Chapter 5
  1028.  
  1029.                                       Windows                                      Windows
  1030.  
  1031.  
  1032.   5.1  Creating Windows  5.1  Creating Windows
  1033.  
  1034.           We have already met windows in  an  earlier chapter. In this chapter, we
  1035.   will explore one of  EMACS'  more powerful features -- text manipulation through
  1036.   multiple windowing. Windows offer you a powerful and easy way  to  edit text. By
  1037.   manipulating a number of  windows  and buffers on the screen simultaneously, you
  1038.   can perform complete  edits  and  revisions  on the computer screen while having
  1039.   your draft text or original data available for reference in another window.
  1040.  
  1041.           You will recall that windows are areas of buffer text  that  you can see
  1042.   on the screen. Because EMACS can support several  screen  windows simultaneously
  1043.   you can use them to  look into different places in the same buffer. You can also
  1044.   use  them to look at text in different buffers. In effect, you can edit  several
  1045.   files at the same time.
  1046.  
  1047.           Let's invoke  EMACS  and  pull  back  our  file on desktop publishing by
  1048.   typing
  1049.  
  1050.        emacs publish.txt
  1051.  
  1052.           When the text appears,  type  the  ^X2 split-current-window command. The                                             ^X2 ____________________
  1053.   window  splits  into  two windows. The window where the cursor resides is called
  1054.   the current window -- in this  case  the  bottom window. Notice that each window      current
  1055.   has  a text area and a mode line. The command line is  however,  common  to  all                                        command line
  1056.   windows on the screen.
  1057.  
  1058.           The two windows on your screen are virtually mirror images of each other
  1059.   because the new window is opened into the same buffer as the one you are in when
  1060.   you issue the open-window command. All commands issued to EMACS are  executed on                ___________ _______
  1061.   the current buffer in the current window.
  1062.  
  1063.           To move the cursor to the  upper  window  (i.e., to make that window the
  1064.   current window, type ^XP previous-window.  Notice the cursor moves to  the upper                       ^XP _______________
  1065.   or previous window. Entering ^XO next-window moves to the next  window. Practice     previous                  ^XO ___________              next
  1066.   moving between windows. You will notice that you can also move into the Function
  1067.   Key menu by entering these commands.
  1068.  
  1069.           Now  move to the upper window. Let's open a new file. On the EMACS  disk
  1070.   is a tutorial file. Let's call it into the upper window by typing:
  1071.  
  1072.        ^X^F
  1073.  
  1074.  
  1075.  
  1076.   17   MicroEMACS Reference Manual                                              Windows
  1077.  
  1078.  
  1079.           and press return.
  1080.  
  1081.           Enter the filename emacs.tut.                             emacs.tut
  1082.  
  1083.           In a  short  time,  the  tutorial file will appear in the window. We now
  1084.   have two windows on the screen, each looking  into  different  buffers.  We have
  1085.   just  used  the  ^X^F  find-file  command to find a file and bring it  into  our                   ^X^F  _________
  1086.   current window.
  1087.  
  1088.           You can scroll  any window up and down with the cursor keys, or with the
  1089.   commands we've learned so far. However, because the area of visible text in each
  1090.   window is relatively small, you can scroll the current window a line at a time.
  1091.  
  1092.           Type ^X^N move-window-down               ^X^N ________________
  1093.  
  1094.           The  current  window scrolls down by one line -- the top  line  of  text
  1095.   scrolls out of view, and the bottom line moves towards the  top  of  the screen.
  1096.   You can imagine, if you  like, the whole window slowly moving down to the end of
  1097.   the buffer in increments of one  line.  The command ^X^P move-window-up  scrolls                                                      ^X^P ______________
  1098.   the window in the opposite direction.
  1099.  
  1100.           As  we have seen, EMACS editing commands are  executed  in  the  current
  1101.   window,  but the program does support a useful feature that allows you to scroll
  1102.   the next window.  M-^Z scroll-next-up  scrolls  the next window up, M-^V scroll-      next          M-^Z ______________                               M-^V _______
  1103.   next-down  scrolls it downward.  From the tutorial  window,  practice  scrolling  _________
  1104.   the window with the desktop publishing text in it up and down.
  1105.  
  1106.           When  you're finished, exit EMACS without saving  any  changes  in  your
  1107.   files.
  1108.  
  1109.  
  1110.           Experiment with splitting the windows  on your screen. Open windows into
  1111.   different buffers and experiment with any other files you may have.  Try editing
  1112.   the text in  each  window, but don't forget to save any changes you want to keep
  1113.   -- you still have to save each buffer separately.
  1114.  
  1115.   5.2  Deleting Windows  5.2  Deleting Windows
  1116.  
  1117.           Windows allow you to perform complex editing tasks  with  ease. However,
  1118.   they become an inconvenience when your screen is cluttered with open windows you
  1119.   have finished using. The simplest solution is to delete  unneeded  windows.  The
  1120.   command ^X0 delete-window will delete the window you are  currently  working  in          ^X0 _____________
  1121.   and move you to the next window.
  1122.  
  1123.           If you have a number of windows open, you can delete all but the current
  1124.   window by entering ^X1 delete-other-windows.                     ^X1 ____________________
  1125.  
  1126.   5.3  Resizing Windows  5.3  Resizing Windows
  1127.  
  1128.           During  complex  editing  tasks, you will probably find it convenient to
  1129.   have a number of windows on the screen simultaneously.  However  this  situation
  1130.  
  1131.  
  1132.                                                                                 18   Windows                                              MicroEMACS Reference Manual
  1133.  
  1134.  
  1135.   may present inconveniences because the more  windows  you have on the screen the
  1136.   smaller  they  are; in some cases, a window may show only a couple of  lines  of
  1137.   text. To increase the  flexibility  and utility of the window environment, EMACS
  1138.   allows you to  resize the window you are working in (called, as you will recall,
  1139.   the  current window) to a convenient size for easier editing, and then shrink it       current
  1140.   when you no longer need it to be so large.
  1141.  
  1142.           Let's  try an example. Load in any EMACS text file and split the current
  1143.   window into two. Now type  ^X^(Shift-6), grow-window. Your current window should                             ^X^(Shift-6)  ___________
  1144.   be the lower one on  the screen. Notice that it increases in size upwards by one
  1145.   line.  If  you  are in the upper window, it increases  in  size  in  a  downward
  1146.   direction. The command ^X^Z, shrink-window correspondingly decreases window size                         ^X^Z  _____________
  1147.   by one line at a time.
  1148.  
  1149.           EMACS  also  allows  you to resize a window more precisely by entering a
  1150.   numeric  argument  specifying  the size of the window in lines.  To  resize  the
  1151.   window this way, press the META  key  and  enter a numeric argument (remember to
  1152.   keep it smaller  than the number of lines on your screen display) then press ^XW                                                                               ^XW
  1153.   resize-window.  The current window will be enlarged or shrunk  to  the number of  _____________
  1154.   lines specified in the numeric argument. For example entering:
  1155.  
  1156.        M-8 ^XW       M-8 ^XW
  1157.  
  1158.           will resize the current window to 8 lines.
  1159.  
  1160.   5.4  Repositioning within a Window  5.4  Repositioning within a Window
  1161.  
  1162.  
  1163.           The  cursor  may  be centered within a window by entering  M-!  or  M-^L                                                                     M-!  or  M-^L
  1164.   redraw-display. This command is  especially  useful  in  allowing you to quickly  ______________
  1165.   locate the cursor if you are  moving  frequently  from window to window. You can
  1166.   also use  this  command  to  move the line containing the cursor to any position
  1167.   within the current window. This is done by using a  numeric  argument before the
  1168.   command.  Type M-<n> M-^L where <n> is the number of the line within the  window                 M-<n> M-^L
  1169.   that you wish the current line to be displayed.
  1170.  
  1171.           The  ^L  clear-and-redraw  command is useful for 'cleaning up' a 'messy'               ^L  ________________
  1172.   screen  that  can  result  of  using  EMACS  on a  mainframe  system  and  being
  1173.   interrupted by a system message.
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.   19   MicroEMACS Reference Manual                                              Windows
  1189.  
  1190.  
  1191.           Chapter 5 summary          _______ _ _______
  1192.  
  1193.           In Chapter  5  you  learned  how  to  manipulate windows and the editing
  1194.   flexibility they offer.
  1195.  
  1196.   Key Binding     Keystroke       Effect  ___ _______     _________       ______
  1197.  
  1198.   open-window     ^X2             Splits current window into two windows if                  ^X2
  1199.                                   space available
  1200.  
  1201.   close-windows   ^X1             Closes all windows except current window                  ^X1
  1202.  
  1203.   next-window     ^XO[oh]         Moves point into next (i.e. downward) window                  ^XO
  1204.  
  1205.   previous-window ^XP             Moves point to previous (i.e. upward) window                  ^XP
  1206.  
  1207.   move-window-down ^X^N           Scrolls current window down one line                   ^X^N
  1208.  
  1209.   move-window-up  ^X^P            Scrolls current window up one line                  ^X^P
  1210.  
  1211.   redraw-display  M ! or          Window is moved so line with point                  M !
  1212.                   M ^L            (with cursor) is at center of window                  M ^L
  1213.  
  1214.   grow-window     M-X ^           Current window is enlarged by one                  M-X ^
  1215.                                   line and nearest window is shrunk by
  1216.                                   one line
  1217.  
  1218.   shrink-window   ^X^Z            Current window is shrunk by one line                  ^X^Z
  1219.                                   and nearest window is enlarged by one line
  1220.  
  1221.   clear-and-redraw ^L             Screen is blanked and redrawn. Keeps                   ^L
  1222.                                   screen updates in sync with your commands
  1223.  
  1224.   scroll-next-up  M-^Z            Scrolls next window up by one line                  M-^Z
  1225.  
  1226.   scroll-next-down M-^V           Scrolls next window down by one line                   M-^V
  1227.  
  1228.   delete-window   ^X0             Deletes current window                  ^X0
  1229.  
  1230.   delete-other-windows ^X1        Deletes all but current window                       ^X1
  1231.  
  1232.   resize-window   ^X^W            Resizes window to a given numeric argument                  ^X^W
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.                                                                                 20   Using a Mouse                                        MicroEMACS Reference Manual
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.                                      Chapter 6                                     Chapter 6
  1252.  
  1253.                                    Using a Mouse                                   Using a Mouse
  1254.  
  1255.  
  1256.           On computers equipped with a mouse, the mouse  can  usually  be  used to
  1257.   make editing  easier.  If  your  computer has a mouse, let's try using it. Start
  1258.   MicroEMACS by typing:
  1259.  
  1260.           emacs publish.txt
  1261.  
  1262.           This brings EMACS  up  and  allows  it  to  edit  the file from the last
  1263.   chapter.  If the function key window is visible on the screen, press the F5  key
  1264.   to cause it to disappear. Now use the ^X2 split-current-window command  to split                                        ^X2 ____________________
  1265.   the screen into two windows.  Next use the ^X^F find-file command to read in the                                             ^X^F _________
  1266.   fang.txt  file.  Now  your screen should  have  two  windows  looking  into  two  fang.txt
  1267.   different files.
  1268.  
  1269.           Grab  the mouse and move it around. On the screen an arrow, or block  of
  1270.   color  appears.  This is called the mouse cursor and can be  positioned  on  any
  1271.   character on the screen. On some computers, positioning the mouse cursor  in the
  1272.   extreme upper right or left corner may  bring  down  menus  which  allow  you to
  1273.   access that computers utilities, sometimes called Desk Accessories.                                                    Desk Accessories
  1274.  
  1275.   6.1  Moving around with the mouse  6.1  Moving around with the mouse
  1276.  
  1277.  
  1278.           Using the mouse button (or the  left  button  if the mouse has more than
  1279.   one), position the mouse over some character in the current  window.   Click the
  1280.   mouse button once. The point  will  move  to  where  the mouse cursor is. If you                         point
  1281.   place the mouse cursor past the end of a line, the point will move to the end of
  1282.   that line.
  1283.  
  1284.           Move  the  mouse cursor into the other window and click on  one  of  the
  1285.   characters there. MicroEMACS will automatically  make  this  window  the current
  1286.   window (notice that the mode line changes) and position the  point  to the mouse
  1287.   cursor. This makes it very easy to use the mouse to switch to a different window
  1288.   quickly.
  1289.  
  1290.   6.2  Dragging around  6.2  Dragging around
  1291.  
  1292.  
  1293.           Besides just using the mouse to move around on the  screen,  you can use
  1294.   the same button to move text. Move the mouse cursor to a character in one of the
  1295.   windows, and click  down... but don't let the button up yet! The point will move
  1296.   to where the mouse cursor is. Now move  the  mouse  cursor  up  or  down  on the
  1297.   screen, and  release  the  button.  The point will again move to where the mouse
  1298.  
  1299.  
  1300.   21   MicroEMACS Reference Manual                                        Using a Mouse
  1301.  
  1302.  
  1303.   cursor  is,  but this time it will bring the text under it along for  the  ride.
  1304.   This is called dragging, and  is how you can make the text appear just where you                 dragging
  1305.   want it to. If you try to drag text out of the current window, EMACS will ignore
  1306.   your attempt and leave the point where you first clicked down.
  1307.  
  1308.           Now, click down on a word in one of the windows, and drag it directly to
  1309.   the left. Release the button and watch as the entire  window  slides, or scrolls                                                                           scrolls
  1310.   to the left.    The missing text has not been deleted, it is simply not visible,
  1311.   off the left  hand  side of the screen. Notice the mode line has changed and now
  1312.   looks like:
  1313.  
  1314.   ==== MicroEMACS 3.11 [<12] () == fang.txt == File: fang.txt =========
  1315.  
  1316.           The number insided the brackets [] shows that the screen is now scrolled
  1317.   12 characters from the left margin.
  1318.  
  1319.           Now grab the same text again, and drag it to the right, pulling the rest
  1320.   of  the text back into the current window. The [<] field will disappear, meaning
  1321.   that the window is no  longer scrolled to the left.  This feature is very useful
  1322.   for  looking  at  wide charts and tables.  Remember, MicroEMACS will only scroll
  1323.   the text in the current window sideways if  you  drag  it  straight to the side,
  1324.   otherwise it will drag the text vertically.
  1325.  
  1326.           Now, place the mouse cursor over a character  on  the  upper  mode line,
  1327.   click down, move the mouse cursor up or down a  few  lines  and  let  go  of the
  1328.   button. The mode  line  moves to where you dragged it,  changing the size of the
  1329.   windows above and below it. If you try to make a window with less than one line,
  1330.   EMACS will not  let  you. Dragging the mode lines can make it very fast and easy
  1331.   for you to rearrange the windows as you would like.
  1332.  
  1333.           If  you  have  a  number  of  different  windows  visible on the screen,
  1334.   positioning the mouse over the mode  line  of  one window and clicking the right
  1335.   mouse button will cause that window to be deleted.
  1336.  
  1337.   6.3  Cut and Paste  6.3  Cut and Paste
  1338.  
  1339.  
  1340.           If  your mouse has two buttons, then you can use the right button to  do
  1341.   some  other things as well. Earlier, we learned how to define a region by  using                                                                  region
  1342.   the M-<space> set-mark command. Now, position the mouse over at the beginning of      M-<space> ________
  1343.   a  region  you  would  like  to copy. Next click and hold down the  right  mouse
  1344.   button. Notice that the point jumps to the mouse cursor and EMACS reports "[Mark
  1345.   Set]". Holding the button down move the mouse to the end of the text you wish to
  1346.   copy and release the mouse button.  Emacs reports "[Region  Copied]"  to let you
  1347.   know it has  copied  the region into the KILL buffer. This has done the same job
  1348.   as the M-W copy-region command.         M-W ___________
  1349.  
  1350.           If you now click the right  mouse  button, without moving the mouse, the
  1351.   region you defined dissapear, being cut from the current buffer. This works just                                      cut
  1352.   like the ^W kill-region command.           ^W ___________
  1353.  
  1354.  
  1355.  
  1356.                                                                                 22   Using a Mouse                                        MicroEMACS Reference Manual
  1357.  
  1358.  
  1359.           If you move the mouse away from where you cut the  text,  and  click the
  1360.   right mouse button down and up without moving the mouse, the  text  in  the KILL
  1361.   buffer gets inserted, or pasted into the current buffer at the point.
  1362.  
  1363.   6.4  Screens  6.4  Screens
  1364.  
  1365.  
  1366.           MicroEMACS can use more than  one  screen  at  once.  Each  screen  is a
  1367.   collection of windows along with a mode line.  These  screens  usually  fill the                _______
  1368.   terminal or computer screen on text based  systems,  but  can  also  be  held in
  1369.   different windows on graphically based systems like MicroSoft Windows, OS/2, the            windows
  1370.   Macintosh Finder and X-Windows. Don't be  confused  by the two different uses of
  1371.   the term "window".  Inside EMACS style editors, a window lets you view part of a                                                    ______
  1372.   buffer. Under graphical operating systems,  a window holds a "virtual terminal",                                                window
  1373.   allowing you to  manipulate  more  than  one  job, editing session or program at
  1374.   once. Within MicroEMACS, these operating  system windows are called screens. All                                                   window
  1375.   these screens are displayed on your current desktop.
  1376.  
  1377.   6.5  Resizing a Screen  6.5  Resizing a Screen
  1378.  
  1379.  
  1380.           You can change the size of a screen. Move the mouse to the last position
  1381.   of  the  command line. Press the left mouse button down. Holding  it,  move  the
  1382.   mouse  to the place you want the new lower right corner. Release the mouse.  The
  1383.   desktop redraws, with your  newly  resized  screen.  MicroEMACS will ignore size
  1384.   changes  that  can not be done, like attempting to pull the  lower  left  corner
  1385.   above the upper right corner of the current screen.
  1386.  
  1387.   6.6  Moving a Screen  6.6  Moving a Screen
  1388.  
  1389.  
  1390.           To change where on the desktop a screen is placed, move the mouse to the
  1391.   upper right  corner  of  the  screen, press the left mouse button down, move the
  1392.   mouse and release it where you want the screen displayed. Again, MicroEMACS will
  1393.   ignore placements that can not be done.
  1394.  
  1395.   6.7  Creating a Screen  6.7  Creating a Screen
  1396.  
  1397.  
  1398.           Creating  a new screen is just like moving a screen, but using the right
  1399.   button. Move  to  the  upper  right of an existing screen, press the right mouse
  1400.   button  down,  and  move the mouse, releasing the button where  the  new  screen
  1401.   should appear. A new screen will  have  a single window, containing the contents                                                   window
  1402.   of  the current window in the copied screen, and will have that window's colors.                                                                  window
  1403.   The new screen will have the copied screen's size.
  1404.  
  1405.   6.8  Switching to a Screen  6.8  Switching to a Screen
  1406.  
  1407.  
  1408.           This is simple. Any mouse command can be done in  any  screen by placing
  1409.   the mouse on a visible  part  of  the  screen  and clicking. The last screen the
  1410.  
  1411.  
  1412.   23   MicroEMACS Reference Manual                                        Using a Mouse
  1413.  
  1414.  
  1415.   mouse is used on comes  to front and is the current screen. Also, the A-C cycle-                                                                        A-C ______
  1416.   screens command brings the rearmost screen to front.  _______
  1417.  
  1418.   6.9  Deleting a Screen  6.9  Deleting a Screen
  1419.  
  1420.  
  1421.           Place the mouse on the command  line  of  the screen you want to delete.
  1422.   Click the right mouse button, the screen will disapear. If  you  delete the only
  1423.   remaining screen on the desktop, MicroEMACS will exit.
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.                                                                                 24   Using a Mouse                                        MicroEMACS Reference Manual
  1469.  
  1470.  
  1471.  
  1472.  
  1473.                                  Chapter 6 Summary                                 Chapter 6 Summary
  1474.  
  1475.           In Chapter 6, you learned how to use the mouse to move the point, switch
  1476.   windows, drag text, and resize windows.  You  also  learned how to use the right
  1477.   mouse button in order to copy and delete  regions  and  yank  them back at other
  1478.   places. And lastly, you learned how to control multiple screens with the mouse.
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.   25   MicroEMACS Reference Manual                                        Using a Mouse
  1525.  
  1526.  
  1527.   Action          Mouse Directions  ______          _____ __________
  1528.  
  1529.   Move Cursor     position mouse cursor over desired location
  1530.                   click down and up with left button
  1531.  
  1532.   Drag Text       position mouse cursor over desired text
  1533.                   click left button down
  1534.                   move to new screen location for text
  1535.                   release mouse button
  1536.  
  1537.   Resize Windows  position mouse cursor over mode line to move
  1538.                   click left button down
  1539.                   move to new location for mode line
  1540.                   release mouse button
  1541.  
  1542.   Delete Window   position mouse cursor over mode line of window to delete
  1543.                   click right mouse button
  1544.  
  1545.   Activate Screen Move mouse over existing screen
  1546.                   click left button down and up
  1547.  
  1548.   Resize Screen   position mouse cursor over last character on message line
  1549.                   click left button down
  1550.                   move to new lower right corner of screen
  1551.                   release mouse button
  1552.  
  1553.   Copy Region     position mouse at beginning of region
  1554.                   click right button down
  1555.                   move to end of region
  1556.                   release mouse button
  1557.  
  1558.   Cut Region      position mouse at beginning of region
  1559.                   click right button down
  1560.                   move to end of region
  1561.                   release mouse button
  1562.                   click right button down and up
  1563.  
  1564.   Paste Region    position mouse at place to paste
  1565.                   click right button down and up
  1566.  
  1567.   Create Screen   position mouse at upper left corner of existing screen
  1568.                   click right button down
  1569.                   move to position of new screen
  1570.                   release mouse button
  1571.  
  1572.   Resize Screen   position mouse at lower right corner of screen
  1573.                   click left button down
  1574.                   move to new lower left corner
  1575.                   release mouse button
  1576.  
  1577.   Move Screen     position mouse at upper right corner of screen
  1578.  
  1579.  
  1580.                                                                                 26   Buffers                                              MicroEMACS Reference Manual
  1581.  
  1582.  
  1583.                   click left button down
  1584.                   move to new screen position
  1585.                   release mouse button
  1586.  
  1587.   Delete Screen   position to command line of existing screen
  1588.                   click right button down
  1589.                   release mouse button
  1590.  
  1591.  
  1592.  
  1593.  
  1594.                                      Chapter 7                                     Chapter 7
  1595.  
  1596.                                       Buffers                                      Buffers
  1597.  
  1598.  
  1599.           We  have  already  learned a number of things about buffers. As you will
  1600.   recall, they are the major internal entities in EMACS -- the place where editing
  1601.   commands are executed. They  are  characterized by their names, their modes, and                                                           names        modes
  1602.   by the file with which they are associated.  Each  buffer  also  "remembers" its
  1603.   mark and point. This convenient feature  allows  you  to go to other buffers and  mark     point
  1604.   return to the original location in the "current" buffer.
  1605.  
  1606.           Advanced users  of  EMACS  frequently  have  a  number of buffers in the
  1607.   computer's memory simultaneously. In the last chapter, for  example,  you opened
  1608.   at least two  buffers  -- one into the text you were editing, and the other into
  1609.   the  EMACS  on-line  tutorial. If you deal  with  complex  text  files  --  say,
  1610.   sectioned chapters of a book, you may have five or six buffers in the computer's
  1611.   memory.  You  could  select different buffers by simply calling up the file with
  1612.   ^X^F find-file, and let EMACS open  or  reopen the buffer. However, EMACS offers  ^X^F _________
  1613.   fast and sophisticated buffering techniques that you will find  easy  to  master
  1614.   and much more convenient to use.
  1615.  
  1616.           Let's begin by opening three buffers. You can open any three you choose,
  1617.   for example call the  following  files  into  memory: fang.txt, publish.txt, and                                                        fang.txt  publish.txt
  1618.   emacs.tut in the order listed here. When you've finished this process, you'll be  emacs.tut
  1619.   looking at a screen showing the  EMACS  tutorial.  Let's assume that you want to
  1620.   move to the fang.txt buffer. Enter:
  1621.  
  1622.           ^XX next-buffer          ^XX ___________
  1623.  
  1624.           This command moves you to the next buffer. Because EMACS  cycles through                                        ____
  1625.   the  buffer list, which is alphabetized, you will now be in the fang.txt buffer.                                                                  fang.txt
  1626.   Using ^XX again places you in the publish.txt buffer. If you  are  on  a machine        ^XX                         publish.txt         __ ___  ___  __  _ _______
  1627.   that supports function keys, using ^XX again places  you  in  the  Function Keys  ____ ________ ________ _____ _____ ^XX _____ ______  ___  __  ___  Function Keys                                     ___                             ________ ____
  1628.   buffer. Using ^XX one last time cycles you back to the beginning of the list.  ______        ^XX
  1629.  
  1630.           If you have a large number of buffers to deal with, this cycling process
  1631.   may  be  slow and inconvenient. The command  ^XB  select-buffer  allows  you  to                                               ^XB  _____________
  1632.   specify  the  buffer you wish to be switched to. When the  command  is  entered,
  1633.   EMACS prompts, "Use buffer:".  Simply enter the buffer name (NOT the file name),
  1634.  
  1635.  
  1636.   27   MicroEMACS Reference Manual                                              Buffers
  1637.  
  1638.  
  1639.   and that buffer will then  become the current buffer. If you type in part of the
  1640.   file name and  press the space bar, EMACS will attempt to complete the name from
  1641.   the list of current buffers.  If it succeeds, it will print the rest of the name
  1642.   and you can hit <NL> to switch to that buffer. If EMACS beeps the bell, there is
  1643.   no such buffer, and you may continue editing the name on the command line.
  1644.  
  1645.           Multiple buffer manipulation and editing  is a complex activity, and you
  1646.   will probably find it very inconvenient to re-save each buffer as you modify it.
  1647.   The command ^X^B list-buffers creates a new window that gives details  about all              ^X^B ____________
  1648.   the  buffers  currently known to EMACS. Buffers  that  have  been  modified  are
  1649.   identified by the "buffer changed" indicator (an asterisk in the second column).
  1650.   You can thus  quickly and easily identify buffers that need to be saved to files
  1651.   before  you exit EMACS. The buffer window also  provides  other  information  --
  1652.   buffer  specific  modes,  buffer size, and buffer name are also listed. To close
  1653.   this window, simply type the close-windows command, ^X1.                                                      ^X1
  1654.  
  1655.           To  delete  any  buffer, type ^XK delete-buffer. EMACS prompts you "Kill                                        ^XK _____________
  1656.   buffer:".  Enter  the  buffer name you want to delete. As  this  is  destructive
  1657.   command,  EMACS  will  ask for confirmation if the buffer was  changed  and  not
  1658.   saved.  Answer Y(es) or N(o). As usual ^G cancels the command.                                         ^G
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.                                                                                 28   Buffers                                              MicroEMACS Reference Manual
  1693.  
  1694.  
  1695.  
  1696.  
  1697.                                  Chapter 7 Summary                                 Chapter 7 Summary
  1698.  
  1699.           In Chapter 7 you learned how to manipulate buffers.
  1700.  
  1701.   Key Binding             Keystroke                      Effect  ___ _______             _________                      ______
  1702.   next-buffer             ^X^X            Switch to the next buffer in the                          ^X^X
  1703.                                           buffer list
  1704.  
  1705.   select-buffer           ^XB             Switch to a particular buffer                          ^XB
  1706.  
  1707.   list-buffers            ^X^B            List all buffers                          ^X^B
  1708.  
  1709.   delete-buffer           ^XK             Delete a particular buffer if it                          ^XK
  1710.                                           is off-screen
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.   29   MicroEMACS Reference Manual                                                Modes
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.                                      Chapter 8                                     Chapter 8
  1756.  
  1757.                                        Modes                                       Modes
  1758.  
  1759.  
  1760.           EMACS allows you to change the way it works in order to customized it to
  1761.   the  style  of  editing  you  are using. It does this by providing a  number  of
  1762.   different  modes.  These  modes can effect either a single buffer,  or  any  new             modes
  1763.   buffer that is created.  To add a mode to the current buffer, type ^XM add-mode.                                                                     ^XM ________
  1764.   EMACS will then prompt you for the name of a  mode  to  add.  When you type in a
  1765.   legal mode name, and type a <NL>, EMACS will add the mode name  to  the  list of
  1766.   current mode names in the mode line of the current buffer.
  1767.  
  1768.           To remove an existing mode, typing the ^X^M delete-mode will cause EMACS                                                 ^X^M ___________
  1769.   to  prompt  you for the name of a mode to delete from the current  buffer.  This
  1770.   will remove that mode from the mode list on the current mode line.
  1771.  
  1772.           Global modes are the modes which are inherited by any new  buffers which
  1773.   are  created.  For  example,  if  you  wish  to always do string searching  with
  1774.   character  case being significant, you would want global mode EXACT to be set so
  1775.   that any new files read in inherent the EXACT mode. Global  modes  are  set with
  1776.   the  M-M add-global-mode command, and unset  with  the  M-^M  delete-global-mode       M-M _______________                                M-^M  __________________
  1777.   command. Also,  the  current  global  modes are displayed in the first line of a
  1778.   ^X^B list-buffers command.  ^X^B ____________
  1779.  
  1780.           On  machines  which  are capable of displaying colors, the mode commands
  1781.   can also set the  background  and foreground character colors. Using add-mode or                                                                       ________
  1782.   delete-mode with a lowercase color will set the background color in  the current  ___________
  1783.   window.  An uppercase color will set the foreground color in the current window.
  1784.   Colors  that EMACS knows about are: white, cyan,  magenta,  yellow,  blue,  red,
  1785.   green, and black. If the computer you are running on does not have eight colors,
  1786.   EMACS will attempt  to make some intelligent guess at what color to use when you
  1787.   ask for one which is not there.
  1788.  
  1789.   8.1  ASAVE mode  8.1  ASAVE mode
  1790.  
  1791.           Automatic Save mode tells EMACS to automatically write  out  the current
  1792.   buffer to its associated file on  a  regular  basis. Normally this will be every
  1793.   256 characters typed into the file. The environment variable $ACOUNT counts down
  1794.   to the next auto-save, and $ASAVE is the  value  used  to  reset $ACOUNT after a
  1795.   save occurs.
  1796.  
  1797.   8.2  CMODE mode  8.2  CMODE mode
  1798.  
  1799.           CMODE is useful to C programmers.  When  CMODE is active, EMACS will try
  1800.   to assist the user in  a  number  of  ways.  This mode is set automatically with
  1801.   files that have a .c or .h extension.
  1802.  
  1803.  
  1804.                                                                                 30   Modes                                                MicroEMACS Reference Manual
  1805.  
  1806.  
  1807.           The <NL> key will normally attempt to return the user  to  the next line
  1808.   at the same  level of indentation as the last non blank line, unless the current
  1809.   line ends with a open brace ({) in which case  the  new  line  will  be  further
  1810.   indented by one tab position.
  1811.  
  1812.           A close brace (}) will search for the corresponding open brace  and line
  1813.   up with it.
  1814.  
  1815.           A pound sign (#) with only leading white space will delete all the white
  1816.   space preceding itself. This will  always bring preprocessor directives flush to
  1817.   the left margin.
  1818.  
  1819.           Whenever any close fence is typed,  IE  )]>}, if the matching open fence
  1820.   is on screen in the current window, the  cursor  will  briefly  flash to it, and
  1821.   then back. This makes balancing expressions, and matching blocks much easier.
  1822.  
  1823.   8.3  CRYPT mode  8.3  CRYPT mode
  1824.  
  1825.           When a buffer is in CRYPT mode, it is encrypted  whenever  it is written
  1826.   to a file,  and  decrypted when it is read from the file. The encryption key can
  1827.   be  specified  on  the  command  line with the -k switch, or with the  M-E  set-                                                                         M-E  ____
  1828.   encryption-key command. If you attempt to read or write a  buffer  in crypt mode  ______________
  1829.   and   now   key   has  not  been  set,  EMACS  will  execute  set-encryption-key                                                                __________________
  1830.   automatically, prompting you for the needed key.  Whenever EMACS prompts you for
  1831.   a key, it will not echo the key to your screen  as you type it (IE make SURE you
  1832.   get it right when you set it originally).
  1833.  
  1834.           The  encryption  algorithm  used  changes  all  characters  into  normal
  1835.   printing  characters,  thus  the resulting file  is  suitable  for  sending  via
  1836.   electronic mail. All version of MicroEMACS should be able decrypt  the resulting
  1837.   file regardless of what machine encrypted  it.  Also available with EMACS is the
  1838.   stand  alone program, MicroCRYPT, which can en/decrypt  the  files  produced  by
  1839.   CRYPT mode in EMACS.
  1840.  
  1841.   8.4  EXACT mode  8.4  EXACT mode
  1842.  
  1843.           All string searches and replacements  will  take  upper/lower  case into
  1844.   account.  Normally the case of a string during a search or replace is not  taken
  1845.   into account.
  1846.  
  1847.   8.5  MAGIC mode  8.5  MAGIC mode
  1848.  
  1849.           In the MAGIC mode certain characters gain special meanings when  used in
  1850.   a search  pattern.  Collectively  they  are  know  as regular expressions, and a
  1851.   limited  number  of  them  are  supported  in  MicroEmacs.  They  grant  greater
  1852.   flexibility  when  using  the  search  command.  They  have  no  affect  on  the
  1853.   incremental search command.
  1854.  
  1855.           The  symbols that have special meaning in MAGIC mode are ^, $, ., &,  ?,
  1856.   *, +, [ (and ], used with it), and \.
  1857.  
  1858.  
  1859.  
  1860.   31   MicroEMACS Reference Manual                                                Modes
  1861.  
  1862.  
  1863.           The characters ^ and $ fix the search pattern to  the  beginning and end
  1864.   of  line,  respectively.  The ^ character must appear at the  beginning  of  the
  1865.   search  string,  and the $ must appear at the end, otherwise  they  loose  their
  1866.   meaning and are treated just like any other  character.  For  example,  in MAGIC
  1867.   mode, searching for the pattern "t$" would put the cursor at the end of any line
  1868.   that ended with the letter 't'. Note that this is  different  than searching for
  1869.   "t<NL>", that is, 't' followed by a newline character. The  character  $ (and ^,
  1870.   for that matter) matches a position, not a character, so  the  cursor remains at
  1871.   the end of the line.  But a newline is a character that must be matched like any
  1872.   other character, which means that the cursor is placed just after  it  -  on the
  1873.   beginning of the next line.
  1874.  
  1875.           The  character  .  has a very simple meaning -- it  matches  any  single
  1876.   character, except the newline. Thus a search for "bad.er" could  match "badger",
  1877.   "badder" (slang), or up to the 'r' of "bad error".
  1878.  
  1879.           The  character [ indicates the beginning of a  character  class.  It  is
  1880.   similar to  the  'any'  character  ., but you get to choose which characters you
  1881.   want to match. The character class is ended with the character  ].  So,  while a
  1882.   search for "ba.e" will match "bane", "bade", "bale", "bate", et cetera,  you can
  1883.   limit it to matching "babe" and "bake" by searching for  "ba[bk]e".  Only one of
  1884.   the characters inside the [ and ] will match a character. If in fact you want to
  1885.   match any character except those  in the character class, you can put a ^ as the
  1886.   first character. It must be  the first character of the class, or else it has no
  1887.   special meaning. So, a search for [^aeiou] will  match  any  character  except a
  1888.   vowel, but a search for [aeiou^] will match any vowel or a ^.
  1889.  
  1890.           If you have  many  characters  in  order,  that  you  want to put in the
  1891.   character class, you may use a dash (-)  as  a  range  character. So, [a-z] will
  1892.   match any letter (or any lower case letter if EXACT mode  is  on),  and [0-9a-f]
  1893.   will match  any  digit  or  any  letter  'a' through 'f', which happen to be the
  1894.   characters for hexadecimal  numbers. If the dash is at the beginning or end of a
  1895.   character class, it is taken to be just a dash.
  1896.  
  1897.           The ? character indicates that  the preceding character is optional. The
  1898.   character may or may not appear in the matched string. For example, a search for
  1899.   "bea?st" would match both "beast" and "best". If there is no  preceding charcter
  1900.   for ? to modify, it is treated as a normal question mark character.
  1901.  
  1902.           The * character  is known as closure, and means that zero or more of the
  1903.   preceding character will match. If there is no preceding character,
  1904.           * has no special meaning  and  is  treated  as  a  normal  asterisk. The
  1905.   closure symbol will  also  have  no  special  meaning  if  it is preceded by the
  1906.   beginning of line symbol ^, since it represents a position, not a character.
  1907.  
  1908.           The notion of  zero  or  more  characters is important. If, for example,
  1909.   your cursor was on the line
  1910.  
  1911.        This line is missing two vowels.
  1912.  
  1913.  
  1914.  
  1915.  
  1916.                                                                                 32   Modes                                                MicroEMACS Reference Manual
  1917.  
  1918.  
  1919.           and a search was made for "a*", the cursor would not move, because it is
  1920.   guaranteed  to  match  no letter 'a' , which satisfies the search conditions. If
  1921.   you  wanted  to search for one or more of the letter 'a', you could  search  for
  1922.   "aa*", which would match the  letter a, then zero or more of them. A better way,
  1923.   however, is to use the + character.
  1924.  
  1925.           The + character behaves in every respect like the * character,  with the
  1926.   exception that its minimum match range is one, not zero.  Thus  the pattern "a+"
  1927.   is identical to "aa*".
  1928.  
  1929.           Under  older  versions  of  MicroEMACS,  the closure symbols  would  not
  1930.   operate on newlines. The current versions no longer have this restriction.
  1931.  
  1932.           The \ is the escape character.  With  the exception of groups, which are
  1933.   explained below, the \ is used at those times when you want to be in MAGIC mode,
  1934.   but also want a regular expression  character  to  be just a character. It turns
  1935.   off the special meaning of the character. So a search for "it\." will search for
  1936.   a line with "it.", and not "it" followed by any other  character.  Or,  a search
  1937.   for "TEST\*+" would match the word TEST followed by one  or  more asterisks. The
  1938.   escape character will also let  you put ^, -, or ] inside a character class with
  1939.   no special side effects.
  1940.  
  1941.           The character pair \( represent the start of a group in a search string.
  1942.   A group is  ended by the character pair \). All characters matched within the \(
  1943.   and \)  are  part  of  a  numbered  group, and may be referenced with the &GROUP
  1944.   function, or with  a \ followed by the group number in the replacement string of
  1945.   replace-string or the  query-replace-string  commands. For example, a search for  ______________         ____________________
  1946.   "INDEX\([0-9]+\)", to be replaced by "getind(\1)" would change
  1947.  
  1948.        indptr := INDEX42
  1949.  
  1950.            to
  1951.  
  1952.        indptr := getind(42)
  1953.  
  1954.           .
  1955.  
  1956.           There may be up to nine groups. Groups may be nested.
  1957.  
  1958.           The character &  (ampersand)  is a replacement character, and represents
  1959.   all the characters which were matched by the search string.  When used in the M-                                                                                M-
  1960.   R replace-string or  the  M-^R  query-replace-string  commands,  the  &  will be  R ______________          M-^R  ____________________
  1961.   substituted for the search string.
  1962.  
  1963.   8.6  OVER mode  8.6  OVER mode
  1964.  
  1965.           OVER mode stands for overwrite mode. When in this mode,  when characters
  1966.   are typed, instead of simply inserting them into the file, EMACS will attempt to
  1967.   overwrite  an  existing  character  past  the  point.   This is very useful  for
  1968.   adjusting tables and diagrams.
  1969.  
  1970.  
  1971.  
  1972.   33   MicroEMACS Reference Manual                                                Modes
  1973.  
  1974.  
  1975.   8.7  WRAP mode  8.7  WRAP mode
  1976.  
  1977.           Wrap mode is used when typing in continuous text. Whenever the cursor is
  1978.   past the currently set fill column (72 by default) and the user types a space or
  1979.   a <NL>, the last word of the line is brought down to the beginning  of  the next
  1980.   line.  Using  this,  one just types a  continuous  stream  of  words  and  EMACS
  1981.   automatically inserts <NL>s at appropriate places.
  1982.  
  1983.                                 NOTE to programmers:
  1984.  
  1985.        The EMACS variable $wraphook contains the name of  the  function which
  1986.        executes when  EMACS  detects  it  is time to wrap. This is set to the
  1987.        function  wrap-word  by  default,  but  can  be  changed  to  activate                 _________
  1988.        different functions and macros at wrap time.
  1989.  
  1990.   8.8  VIEW mode  8.8  VIEW mode
  1991.  
  1992.           VIEW mode disables all  commands  which  can  change the current buffer.
  1993.   EMACS will display  an error message and ring the bell every time you attempt to
  1994.   change a buffer in VIEW mode.
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.                                                                                 34   Modes                                                MicroEMACS Reference Manual
  2029.  
  2030.  
  2031.  
  2032.  
  2033.                                  Chapter 8 Summary                                 Chapter 8 Summary
  2034.  
  2035.           In Chapter 8 you learned about modes and their effects.
  2036.  
  2037.   Key Binding             Keystroke                      Effect  ___ _______             _________                      ______
  2038.   add-mode                ^XM             Add a mode to the current buffer                          ^XM
  2039.  
  2040.   delete-mode             ^X^M            Delete a mode from the current buffer                          ^X^M
  2041.  
  2042.   add-global-mode         M-M             Add a global mode to the                          M-M
  2043.                                           current buffer
  2044.  
  2045.   delete-global-mode      M-^M            Delete a global mode from the                          M-^M
  2046.                                           current buffer
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.   35   MicroEMACS Reference Manual                                                Files
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.                                      Chapter 9                                     Chapter 9
  2092.  
  2093.                                        Files                                       Files
  2094.  
  2095.  
  2096.           A file is simply a collection of related data. In  EMACS  we are dealing
  2097.   with  text files -- named collections of text residing on a disk (or some  other
  2098.   storage  medium).  You  will recall that the major entities EMACS deals with are
  2099.   buffers. Disk-based versions  of  files  are  only  active in EMACS when you are
  2100.   reading into  or  writing  out  of buffers. As we have already seen, buffers and
  2101.   physical  files are linked by associated file names.  For  example,  the  buffer
  2102.   "ch7.txt" which is associated with the physical disk file  "ch7.txt."  You  will
  2103.   notice that the file is usually specified by the drive name or (in the case of a
  2104.   hard drive) a path. Thus you can specify full file names in EMACS,
  2105.  
  2106.           e.g. disk:\directories\filename.extension
  2107.  
  2108.           If you do not specify a disk and directories, the  default  disk and the
  2109.   current directory is used.
  2110.  
  2111.           IMPORTANT -- If you do not  explicitly  save  your buffer to a file, all
  2112.   your edits  will  be  lost  when you leave EMACS (although EMACS will prompt you
  2113.   when you are  about  to  lose  edits  by  exiting).  In addition, EMACS does not
  2114.   protect your disk-based files from overwriting  when  it saves files.  Thus when
  2115.   you instruct EMACS to  save  a  file  to  disk,  it  will  create  a file if the
  2116.   specified file doesn't exist, or it will overwrite the previously  saved version
  2117.   of the file thus replacing it. Your old version is gone forever.
  2118.  
  2119.           If you are at all unsure about your edits, or if  (for  any  reason) you
  2120.   wish  to  keep  previous versions of a file, you can  change  the  name  of  the
  2121.   associated file with the  command  ^XN change-file-name. When this file is saved                                     ^XN ________________
  2122.   to  disk, EMACS will create a new physical file under the new name. The  earlier
  2123.   disk file will be preserved.
  2124.  
  2125.           For example, let's load the file fang.txt into EMACS. Now, type ^XN. The                                           fang.txt                       ^XN
  2126.   EMACS command line prompts "Name:". Enter a new name for the file -- say new.txt                                                                           new.txt
  2127.   and press <NL>. The file will be saved  under  the  new  filename, and your disk
  2128.   directory will show both fang.txt and new.txt.                           fang.txt     new.txt
  2129.  
  2130.           An  alternative method is to write the file directly to disk under a new
  2131.   filename. Let's pull our "publish.txt" file into EMACS. To write this file under
  2132.   another filename, type ^X^W  write-file.  EMACS  will  prompt you "write file:".                         ^X^W  __________
  2133.   Enter  an  alternate  filename -- desktop.txt. Your file will be  saved  as  the                                    desktop.txt
  2134.   physical file "desktop.txt".
  2135.  
  2136.           Note that in the examples above, although you have changed the  names of
  2137.   the  related files, the buffer names remain the same. However, when you pull the
  2138.  
  2139.  
  2140.                                                                                 36   Files                                                MicroEMACS Reference Manual
  2141.  
  2142.  
  2143.   physical file back into EMACS, you will find that the buffer name now relates to
  2144.   the filename.
  2145.  
  2146.           For example -- You are working with a buffer "fang.txt" with the related
  2147.   file "fang.txt". You change the name of the file to  "new.txt".  EMACS now shows
  2148.   you working with the buffer "fang.txt" and the related file "new.txt".  Now pull
  2149.   the file "new.txt" into EMACS. Notice  that  the  buffer name has now changed to
  2150.   "new.txt".
  2151.  
  2152.           If for any reason a conflict  of  buffer names occurs,(if you have files
  2153.   of the  same  name  on  different drives for example) EMACS will prompt you "use
  2154.   buffer:". Enter an alternative buffer name if you need to.
  2155.  
  2156.           For a list of file related commands (including some we`ve already seen),
  2157.   see the summary page.
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.   37   MicroEMACS Reference Manual                                                Files
  2197.  
  2198.  
  2199.  
  2200.  
  2201.                                  Chapter 9 Summary                                 Chapter 9 Summary
  2202.  
  2203.           In Chapter 9  you  learned  some  of  the more advanced concepts of file
  2204.   naming  and  manipulation.  The  relationship  between  files  and  buffers  was
  2205.   discussed in some detail.
  2206.  
  2207.   Key Binding     Keystroke       Effect  ___ _______     _________       ______
  2208.  
  2209.   save-file       ^X^S            Saves contents of current buffer with                  ^X^S
  2210.                                   associated filename on default disk/
  2211.                                   directory (if not specified)
  2212.  
  2213.   write-file      ^X^W            Current buffer contents will be                  ^X^W
  2214.                                   saved under specified name
  2215.  
  2216.   change-file-name
  2217.                   ^XN             The associated filename is changed                  ^XN
  2218.                                   (or associated if not previously
  2219.                                   specified) as specified
  2220.  
  2221.   find-file       ^X^F            Reads specified file into buffer and                  ^X^F
  2222.                                   switches you to that buffer, or switches
  2223.                                   to buffer in which the file has previously
  2224.                                   been read
  2225.  
  2226.   read-file       ^X^R            Reads file into buffer thus overwriting                  ^X^R
  2227.                                   buffer contents. If file has already
  2228.                                   been read into another buffer, you will
  2229.                                   be switched to it
  2230.  
  2231.   view-file       ^X^V            The same as read-file except the buffer                  ^X^V
  2232.                                   is automatically put into VIEW mode thus
  2233.                                   preventing any changes from being made
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.                                                                                 38   Screen Formatting                                    MicroEMACS Reference Manual
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.                                      Chapter 10                                     Chapter 10
  2260.  
  2261.                                  Screen Formatting                                 Screen Formatting
  2262.  
  2263.  
  2264.   10.1  Wrapping Text  10.1  Wrapping Text
  2265.  
  2266.  
  2267.           As we learned in the introduction, EMACS is not a word processor, but an
  2268.   editor. Some simple formatting options are available however,  although  in most
  2269.   cases they will not affect the appearance of the finished text  when  it  is run
  2270.   through the formatter. We  have  already encountered WRAP mode which wraps lines
  2271.   longer  than  a  certain length (default is 75 characters). You will recall that
  2272.   WRAP is enabled by entering ^XM and responding to the  command  line prompt with                              ^XM
  2273.   wrap.  wrap
  2274.  
  2275.           You can also set your own wrap margin  with  the  command  ^XF set-fill-                                                                     ^XF _________
  2276.   column.  Notice  EMACS  responds "[Fill column is 1]." Now try typing some text.  ______
  2277.   You'll notice some very strange things happening --  your  text  wraps  at every
  2278.   word!! This effect occurs because the  set  wrap margin command must be preceded
  2279.   by  a  numeric  argument or EMACS sets it to the first column. Thus any text you
  2280.   type that extends past the first  column  will  wrap at the most convenient line
  2281.   break.
  2282.  
  2283.           To reset the  wrap  column  to  72  characters, press the <META> key and                                                                    <META>
  2284.   enter 72. EMACS will respond "Arg: 72". Now press ^XF. EMACS will respond "[Fill                                                    ^XF
  2285.   column is 72]". Your text  will again wrap at the margin you've been using up to
  2286.   this point.
  2287.  
  2288.   10.2  Reformatting Paragraphs  10.2  Reformatting Paragraphs
  2289.  
  2290.  
  2291.           After  an  intensive  editing  session,  you  may  find  that  you  have
  2292.   paragraphs containing lines  of  differing lengths. Although this disparity will
  2293.   not  affect the formatted text, aesthetic and technical  concerns  may  make  it
  2294.   desirable  to have consistent paragraph blocks on the screen. If you are in WRAP
  2295.   mode, you can  reformat  a  paragraph  with the command M-Q fill-paragraph. This                                                          M-Q ______________
  2296.   command 'fills'  the  current  paragraph  reformatting  it  so all the lines are
  2297.   filled and wrap logically.
  2298.  
  2299.   10.3  Changing Case  10.3  Changing Case
  2300.  
  2301.  
  2302.           There  may be occasions when you find it necessary to change the case of
  2303.   the text you've entered. EMACS allows you  to  change  the  case  of  even large
  2304.   amounts  of  text  with  ease.  Let's  try  and convert  a  few  of  the  office
  2305.   traditionalists to the joy of word processing. Type in the following text:
  2306.  
  2307.  
  2308.   39   MicroEMACS Reference Manual                                    Screen Formatting
  2309.  
  2310.  
  2311.        Throw  away  your  typewriter and learn to use a word processor.  Word
  2312.        processing  is  relatively  easy  to  learn  and  will  increase  your
  2313.        productivity enormously. Enter the Computer  Age and find out just how
  2314.        much fun it can be!!
  2315.  
  2316.           Let's give it a little more impact by capitalizing the first four words.
  2317.   The first step is to define the region of text just as  you  would  if  you were
  2318.   doing an extensive deletion. Set the mark at the beginning of the paragraph with
  2319.   M-<space> set-mark and  move  the  cursor  to the space beyond "typewriter." Now  M-<space> ________
  2320.   enter ^X^U case-region-upper.  Your text should now look like this:        ^X^U _________________
  2321.  
  2322.        THROW  AWAY  YOUR  TYPEWRITER and learn to use a word processor.  Word
  2323.        processing  is  relatively  easy  to  learn  and  will  increase  your
  2324.        productivity enormously. Enter the Computer  Age and find out just how
  2325.        much fun it can be!!
  2326.  
  2327.           If you want to change the text  back  to  lower  case,  type  ^X^L case-                                                                        ^X^L _____
  2328.   region-lower. You can also capitalize individual words. To  capitalize  the word  ____________
  2329.   "fun",  position  the  cursor in front of the word and type M-U case-word-upper.                                                              M-U _______________
  2330.   The word is now capitalized. To change it ck to lower case, move the cursor back
  2331.   to the beginning of the word and type M-L case-word-lower.                                        M-L _______________
  2332.  
  2333.           You may also capitalize  individual  letters  in  EMACS. The command M-C                                                                               M-C
  2334.   case-word-capitalize capitalizes  the first letter after the point. This command  ____________________
  2335.   would normally be issued with the cursor positioned in front of the first letter
  2336.   of the word you wish to capitalize. If you issue it in the middle of a word, you
  2337.   can end up with some strAnge looking text.
  2338.  
  2339.   10.4  Tabs  10.4  Tabs
  2340.  
  2341.  
  2342.           Unless  your  formatter  is instructed to take screen text literally (as
  2343.   MicroSCRIBE  does  in  the  'verbatim'  environment for example), tabs in  EMACS
  2344.   generally affect screen formatting only.
  2345.  
  2346.           When EMACS is first started, it sets the  default  tab  to  every eighth
  2347.   column. As long as you stay with default, every time you press the tab key a tab
  2348.   character, ^I is inserted.  This  character,  like  other control characters, is             ^I
  2349.   invisible -- but it makes a subtle and significant difference  to  your file and
  2350.   editing.
  2351.  
  2352.           For example, in default mode, press the tab key and  then  type the word
  2353.   Test.  "Test" appears at the eighth column. Move your cursor to the beginning of  Test
  2354.   the  word and delete the backward character. The word doesn't move back just one
  2355.   character,  but  flushes to the left margin.  The reason for  this  behavior  is
  2356.   easily explained. In tab default, EMACS inserts a 'real' tab character  when you
  2357.   press the tab key. This character  is  inserted  at the default position, but NO
  2358.   SPACES  are  inserted  between the tab character and the margin (or previous tab
  2359.   character). As you will recall, EMACS only recognizes characters (such as spaces
  2360.   or letters) and  thus when the tab character is removed, the text beyond the tab
  2361.   is flushed back to the margin or previous tab mark.
  2362.  
  2363.  
  2364.                                                                                 40   Screen Formatting                                    MicroEMACS Reference Manual
  2365.  
  2366.  
  2367.           This  situation  changes  if you alter the  default  configuration.  The
  2368.   default value may be changed by entering a numeric argument before  pressing the
  2369.   tab  key. As we saw earlier, pressing the META key and entering a number  allows                                            META
  2370.   you to specify how EMACS performs a given action. In this case, let's specify an
  2371.   argument of 10 and hit the tab key.
  2372.  
  2373.           Now hit the  tab key again and type Test. Notice the word now appears at                                              Test
  2374.   the tenth column.  Now move to the beginning of the word and delete the backward
  2375.   character. "Test" moves back by one character.
  2376.  
  2377.           EMACS behaves  differently in these circumstances because the ^I handle-                                                                        ^I _______
  2378.   tab function deals with tabbing in two distinct ways. In default  conditions, or  ___
  2379.   if the  numeric  argument  of  zero  is  used,  handle-tab  inserts  a  true tab                                                  __________
  2380.   character. If, however, a non-zero  numeric  argument  is  specified, handle-tab                                                                        __________
  2381.   inserts the correct number of spaces needed to position the  cursor  at the next
  2382.   specified  tab  position.  It does NOT insert the single tab character and hence
  2383.   any editing functions should take account of the number of spaces between tabbed
  2384.   columns.
  2385.  
  2386.           The distance which a true tab character moves the cursor can be modified
  2387.   by changing the value of the $hardtab environment variable.  Initially set to 8,
  2388.   this will determine  how far each tab stop is placed from the previous one. (Use
  2389.   the ^XA set command to set the value of an environment variable).          ___
  2390.  
  2391.           Many  times you would like to take text which has been created using the
  2392.   tab  character  and  change it to use just spaces. The command ^X^D detab-region                                                                 ^X^D ____________
  2393.   changes  any  tabs  in the currently selected region into the  right  number  of
  2394.   spaces so the text does  not change. This is very useful for times when the file
  2395.   must be printed or transferred to a machine which does not understand tabs.
  2396.  
  2397.           Also, the  inverse command, ^X^E entab-region changes multiple spaces to                                      ^X^E ____________
  2398.   tabs where possible.  This  is a good way to shrink the size of large documents,
  2399.   especially with data tables. Both of these commands can take a  numeric argument
  2400.   which will be interpreted as the number of lines to en/detab.
  2401.  
  2402.           Another function, related  to  those  above  is provided for by the ^X^T                                                                              ^X^T
  2403.   trim-region when invoked will delete any trailing white space  in  the  selected  ___________
  2404.   region. A preceding numeric argument will do this for that number of lines.
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.   41   MicroEMACS Reference Manual                                    Screen Formatting
  2421.  
  2422.  
  2423.  
  2424.  
  2425.                                  Chapter 10 Summary                                 Chapter 10 Summary
  2426.  
  2427.           In Chapter 10 introduced some of the formatting features of EMACS. Text-
  2428.   wrap, paragraph reformatting,  and  tabs  were  discussed  in  some  detail. The
  2429.   commands in the following table were covered in the chapter.
  2430.  
  2431.  
  2432.   Key Binding             Keystroke                   Effect  ___ _______             _________                   ______
  2433.   add-mode/WRAP           ^XM[WRAP]       Add wrap mode to current buffer                          ^XM
  2434.  
  2435.   delete-mode/WRAP        ^X^M[WRAP]      Remove wrap mode from current buffer                          ^X^M
  2436.  
  2437.   set-fill-column         ^XF             Set fill column to given numeric                          ^XF
  2438.                                           argument
  2439.  
  2440.   fill-paragraph          M-Q             Logically reformats the current                          M-Q
  2441.                                           paragraph
  2442.  
  2443.   case-word-upper         M-U             Text from point to end of the                          M-U
  2444.                                           current word is changed to uppercase
  2445.  
  2446.   case-word-lower         M-L             Text from point to end of the                          M-L
  2447.                                           current word is changed to lowercase
  2448.  
  2449.   case-word-capitalize    M-C             First word (or letter) after the                          M-C
  2450.                                           point is capitalized
  2451.  
  2452.   case-region-upper       ^X^U            The current region is uppercased                          ^X^U
  2453.  
  2454.   case-region-lower       ^X^L            The current region is lowercased                          ^X^L
  2455.  
  2456.   handle-tab              ^I              Tab interval is set to the given                          ^I
  2457.                                           numeric argument
  2458.  
  2459.   entab-region            ^X^E            Changes multiple spaces to tabs                          ^X^E
  2460.                                           characters where possible
  2461.  
  2462.   detab-region            ^X^D            Changes tab characters to the                          ^X^D
  2463.                                           appropriate number of spaces
  2464.  
  2465.   trim-region             ^X^T            Trims white space from the end                          ^X^T
  2466.                                           of the lines in the current region
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.                                                                                 42   Access to the Outside World                          MicroEMACS Reference Manual
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.                                      Chapter 11                                     Chapter 11
  2484.  
  2485.                             Access to the Outside World                            Access to the Outside World
  2486.  
  2487.  
  2488.           EMACS has the ability to interface to other programs and the environment
  2489.   of the  computer  outside  of  itself. It does this through a series of commands
  2490.   that allow it to talk to  the  computer's  command processor or shell. Just what                                             command processor    shell
  2491.   this is varies between different computers. Under MSDOS  or  PCDOS  this  is the
  2492.   command.com command processor.   Under UNIX it is the csh shell. On the Atari ST  command.com                                           csh
  2493.   is can be the Mark Williams MSH or the Beckmeyer shell. In each case, it  is the                              MSH
  2494.   part of the computer's operating system that is responsible for determining what
  2495.   programs are executed, and when.
  2496.  
  2497.           The ^X! shell-command  command  prompts  the  user for a command line to              ^X! _____________
  2498.   send  out  to  the shell to execute. This can be  very  useful  for  doing  file
  2499.   listings and changing the current directory or folder. EMACS  gives  control  to
  2500.   the shell, which executed the command,  and  then  types [END] and waits for the                                                           [END]
  2501.   user  to  type  a character before redrawing the screen and resuming editing. If
  2502.   the  shell-command  command  is used from within the macro language, there is no       _____________
  2503.   pause.
  2504.  
  2505.           ^X@ pipe-command command allows EMACS to execute a shell command, and if          ^X@ ____________
  2506.   the  particular  computer  allows it, send the results into a  buffer  which  is
  2507.   automatically displayed on the  screen.  The  resulting buffer, called "command"
  2508.   can be manipulated just like any other editing buffer. Text can be copied out of
  2509.   it or rearranged as needed. This buffer is originally created  in  VIEW mode, so                                                                     VIEW
  2510.   remember to ^X^Mview<NL> in order to change it.              ^X^Mview<NL>
  2511.  
  2512.           Many computers provide tools which will allow you to filter text, making                                                               filter
  2513.   some  modifications to it along the way. A very common tool is the SORT  program                                                                     SORT
  2514.   which accepts a file, sorts it,  and  prints  the result out. The EMACS command,
  2515.   ^X# filter-buffer sends the current buffer through such a filter.  Therefore, if  ^X# _____________
  2516.   you wished to  sort the current buffer on a system which supplied a sort filter,
  2517.   you would  type  ^X#sort<NL>.    You can also create your own filters by writing                   ^X#sort<NL>
  2518.   programs  and  utilities  which  read  text  from  the  keyboard and display the
  2519.   results.  EMACS will use any of these which would normally be available from the
  2520.   current shell.
  2521.  
  2522.           If  you  would  like  to  execute another program directly, without  the
  2523.   overhead of an intervening  shell,  you can use the ^X$ execute-program command.                                                      ^X$ _______________
  2524.   It  will  prompt you for an external program and its arguments  and  attempt  to
  2525.   execute  it.  Like when EMACS looks for command files, EMACS will look first  in
  2526.   the  HOME  directory,  then down the execute PATH, and finally  in  the  current
  2527.   directory for the named program. On some systems, it will automatically tack the
  2528.   proper  extension on the file name to indicate it is a program. On some  systems
  2529.   that don't support this function, ^X$ will be equivalent to ^X! shell-command.                                    ^X$                       ^X! _____________
  2530.  
  2531.  
  2532.   43   MicroEMACS Reference Manual                          Access to the Outside World
  2533.  
  2534.  
  2535.           Sometimes, you would like to get back to  the  shell  and  execute other
  2536.   commands, without losing the current contents of EMACS. The ^XC  i-shell command                                                              ^XC  _______
  2537.   shells out of EMACS, leaving EMACS in the computer and executing another command
  2538.   shell. Most systems would allow you to return to EMACS with the "exit" command.
  2539.  
  2540.           On some systems, mainly advanced versions of UNIX, you can  direct EMACS          __ ____ ________ ______ ________ ________ __ _____ ___ ___  ______ _____
  2541.   to  "go into the background" with the ^XD  suspend-emacs  command.  This  places  __  ___ ____ ___ ___________ ____ ___ ^XD  _____________  ________  ____  ______                                        ___
  2542.   EMACS in the background returning you  to  the original command shell. EMACS can  _____ __ ___ __________ _________ ___  __  ___ ________ _______ ______ _____ ___
  2543.   then be returned to at any time with the "fg" foreground command.  ____ __ ________ __ __ ___ ____ ____ ___ ____ __________ ________
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.                                                                                 44   Access to the Outside World                          MicroEMACS Reference Manual
  2589.  
  2590.  
  2591.  
  2592.  
  2593.                                  Chapter 11 Summary                                 Chapter 11 Summary
  2594.  
  2595.           In Chapter 11 introduced different ways to access the computers shell or
  2596.   command processor from within EMACS. The commands in the  following  table  were
  2597.   covered in the chapter.
  2598.  
  2599.  
  2600.   Key Binding             Keystroke                   Effect  ___ _______             _________                   ______
  2601.   execute-program         ^X$             Execute an external program                          ^X$
  2602.                                           directly
  2603.  
  2604.   filter-command          ^X#             Send the current buffer through                          ^X#
  2605.                                           a shell filter
  2606.  
  2607.   i-shell                 ^XC             Escape to a new shell                          ^XC
  2608.  
  2609.   pipe-command            ^X@             Send the results of an external                          ^X@
  2610.                                           shell command to a buffer
  2611.  
  2612.   shell-command           ^X!             Execute one shell command                          ^X!
  2613.  
  2614.   suspend-emacs           ^XD             Place EMACS in the background                          ^XD
  2615.                                           (some UNIX systems only)
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.   45   MicroEMACS Reference Manual                                      Keyboard Macros
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.                                      Chapter 12                                     Chapter 12
  2652.  
  2653.                                   Keyboard Macros                                  Keyboard Macros
  2654.  
  2655.  
  2656.           In many applications, you may need  to  repeat a series of characters or
  2657.   commands frequently. For example, a paper may require the frequent repetition of
  2658.   a complex formula  or  a long name. You may also have a series of EMACS commands
  2659.   that  you  invoke  frequently. Keyboard macros  offer  a  convenient  method  of
  2660.   recording and repeating these commands.
  2661.  
  2662.           Imagine, for example, you  are  writing  a  scholarly paper on Asplenium                                                                         _________
  2663.   platyneuron, the spleenwort fern. Even  the  dedicated  botanist  would probably  ___________
  2664.   find  it  a  task bordering on  the  agonizing  to  type  Asplenium  platyneuron                                                            _________  ___________
  2665.   frequently throughout the paper. An alternative method is 'record' the name in a
  2666.   keyboard macro. Try it yourself.
  2667.  
  2668.           The command ^X( begin-macro starts  recording the all the keystrokes and                      ^X( ___________
  2669.   commands you input. After you've typed it, enter Asplenium platyneuron.  To stop                                                   Asplenium platyneuron
  2670.   recording, type ^X) end-macro.  EMACS  has stored all the keystrokes between the                  ^X) _________
  2671.   two commands. To repeat the name you've stored, just  enter  ^XE  execute-macro,                                                               ^XE  _____________
  2672.   and  the name "Asplenium platyneuron" appears. You can  repeat  this  action  as
  2673.   often as you  want,  and of course as with any EMACS command, you may precede it
  2674.   with a numerical argument to repeat it many times.
  2675.  
  2676.           Because EMACS records  keystrokes,  you may freely intermix commands and
  2677.   text. Unfortunately, you  can only store one macro at a time. Thus, if you begin
  2678.   to record another macro, the previously defined macro  is  lost.  Be  careful to
  2679.   ensure that you've finished with one macro before defining another. If  you have
  2680.   a series of commands that you would like  to  'record'  for  future use, use the
  2681.   procedure facilities detailed in chapter 13.
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.                                                                                 46   Keyboard Macros                                      MicroEMACS Reference Manual
  2701.  
  2702.  
  2703.  
  2704.  
  2705.                                  Chapter 12 Summary                                 Chapter 12 Summary
  2706.  
  2707.           Chapter 12 covered keyboard macros. You learned how to record keystrokes
  2708.   and how to repeat the stored sequence.
  2709.  
  2710.   Key Binding             Keystroke               Effect  ___ _______             _________               ______
  2711.  
  2712.   start-macro             ^X(             Starts recording all keyboard input                          ^X(
  2713.  
  2714.   end-macro               ^X)             Stops recording keystrokes for macro                          ^X)
  2715.  
  2716.   execute-macro           ^XE             Entire sequence of recorded                          ^XE
  2717.                                           keystrokes is replayed
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.   47   MicroEMACS Reference Manual                                MicroEMACS Procedures
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.                                      Chapter 13                                     Chapter 13
  2764.  
  2765.                                MicroEMACS Procedures                               MicroEMACS Procedures
  2766.  
  2767.  
  2768.           Procedures,  or  macros,  are  programs  that are used to customize  the
  2769.   editor  and to perform complicated editing tasks. They may be stored in files or
  2770.   buffers  and  may  be executed using an  appropriate  command,  or  bound  to  a
  2771.   particular keystroke. Portions of the standard start-up file are implemented via
  2772.   procedures, as  well  as  the  built in help system. The M-^E run command causes                                                           M-^E ___
  2773.   named procedures to be executed. The execute-file command allows you  to execute                                       ____________
  2774.   a  procedure stored in a disk file, and the execute-buffer command allows you to                                              ______________
  2775.   execute a procedure stored in a buffer. Procedures are stored for easy execution
  2776.   by executing files that contain the store-procedure command.
  2777.  
  2778.           In a command file, the store-procedure command takes  a  string argument                                 _______________
  2779.   which is the name of a procedure to store. These procedures than can be executed
  2780.   with the M-^E run command. Also,  giving  the  name of a stored procedure within           M-^E ___
  2781.   another procedure will executed that named procedure as if it had been called up
  2782.   with the run command.           ___
  2783.  
  2784.           Some  fairly length examples of MicroEMACS procedures  can  be  seen  by
  2785.   examining the standard  files  that  come  with EMACS. The emacs.rc file (called                                                             emacs.rc
  2786.   .emacsrc)  under UNIX) is the MicroEMACS command file  which  is  executed  when  .emacsrc
  2787.   EMACS is normally run. It contains a number of different stored procedures along
  2788.   with the lines to setup and display the Function key window and to call up other
  2789.   procedures and command files using function keys.
  2790.  
  2791.           There  are many different aspects to  the  language  within  MicroEMACS.
  2792.   Editor commands are the various commands that manipulate text, buffers, windows,
  2793.   et cetera, within the  editor.  Directives are commands which control what lines
  2794.   get  executed  within  a macro. Also  there  are  various  types  of  variables.
  2795.   Environmental  variables both control and report on  different  aspects  of  the
  2796.   editor. User variables hold string values which may be  changed  and  inspected.
  2797.   Buffer  variables  allow  text to be placed into variables. Interactive variable
  2798.   allow the program to prompt the user for information. Functions  can  be used to
  2799.   manipulate all these variables.
  2800.  
  2801.   13.1  Constants  13.1  Constants
  2802.  
  2803.  
  2804.           All constants and variable contents in EMACS are stored  as  strings  of
  2805.   characters. Numbers are stored  digit  by digit as characters. This allows EMACS
  2806.   to be "typeless",  not  having  different  variables types be legal in different
  2807.   contexts. This has the disadvantage of forcing the user to be more careful about
  2808.   the context of the statements variables  are  placed  in, but in turn gives them
  2809.  
  2810.  
  2811.  
  2812.                                                                                 48   MicroEMACS Procedures                                MicroEMACS Reference Manual
  2813.  
  2814.  
  2815.   more flexibility in where they can  place  variables. Needless to say, this also
  2816.   allows EMACS's expression evaluator to be both concise and quick.
  2817.  
  2818.           Wherever  statements  need  to have arguments,  it  is  legal  to  place
  2819.   constants.  A  constant  is a double quote character, followed by  a  string  of
  2820.   characters,  and  terminated  by another double quote  character.  To  represent
  2821.   various special characters within  a  constant, the tilde (~) character is used.
  2822.   The  character following the tilde is interpreted  according  to  the  following
  2823.   table:
  2824.  
  2825.   Sequence        Result  ________        ______
  2826.   ~n                      EMACS newline character (breaks lines)
  2827.   ~r              ^M      carriage return
  2828.   ~l              ^J      linefeed
  2829.   ~~              ~       tilde
  2830.   ~b              ^H      backspace
  2831.   ~f              ^L      formfeed
  2832.   ~t              ^I      tab
  2833.   ~"              "       quote
  2834.  
  2835.           Any character not  in  the  table  which  follows a tilde will be passed
  2836.   unmodified. This action is similar to the ^Q  quote-character  command available                                            ^Q  _______________
  2837.   from the keyboard.
  2838.  
  2839.           EMACS may use different characters  for  line  terminators  on different
  2840.   computers. The ~n  combination  will  always  get  the  proper  line terminating
  2841.   sequence for the current system.
  2842.  
  2843.           The double quotes  around  constants  are  not  needed  if  the constant
  2844.   contains  no internal white space and it also does not happen to meet the  rules
  2845.   for  any  other  EMACS  commands,  directives, variables, or functions. This  is
  2846.   reasonable useful for numeric constants.
  2847.  
  2848.   13.2  Variables  13.2  Variables
  2849.  
  2850.  
  2851.           Variables in MicroEMACS procedures can be used to  return  values within
  2852.   expressions, as repeat counts to editing commands, or  as  text  to  be inserted
  2853.   into buffers and messages. The value of these variables is set using the set ^XA                                                                               ^XA
  2854.   command.  For  example,  to set the current fill column to  64  characters,  the
  2855.   following macro line would be used:
  2856.  
  2857.           set $fillcol 64
  2858.  
  2859.           or to have the contents of  %name  inserted  at the point in the current                                      %name
  2860.   buffer, the command to use would be:
  2861.  
  2862.           insert-string %name
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.   49   MicroEMACS Reference Manual                                MicroEMACS Procedures
  2869.  
  2870.  
  2871.  
  2872.   13.2.1  Environmental Variables  13.2.1  Environmental Variables
  2873.  
  2874.  
  2875.           "What good is a quote if you can't change it?"
  2876.  
  2877.           These  variables are used to change different aspects  of  the  way  the
  2878.   editor  works. Also they will return the current settings if used as part of  an
  2879.   expression. All environmental variable names begin with a dollar  sign  ($)  and
  2880.   are in lower case.
  2881.  
  2882.   $acount            The countdown of inserted  characters  until  the  next save-
  2883.                      file.
  2884.  
  2885.   $asave             The  number  of  inserted  characters between automatic file-
  2886.                      saves in ASAVE mode.
  2887.  
  2888.   $bufhook           The function named in  this  variable is run when a buffer is
  2889.                      entered. It can be used to implement modes which are specific
  2890.                      to a paricular file or file type.
  2891.  
  2892.   $cbflags           Current buffer attribute flags (See appendix G for details).
  2893.  
  2894.   $cbufname          Name of the current buffer.
  2895.  
  2896.   $cfname            File name of the current buffer.
  2897.  
  2898.   $cmdhook           Name of function to run before accepting a  command.  This is
  2899.                      by default set to nop.                                       ___
  2900.  
  2901.   $cmode             Integer containing  the  mode  of  the  current  buffer. (See
  2902.                      Appendix F for values).
  2903.  
  2904.   $curchar           Ascii value of the character currently at the point.
  2905.  
  2906.   $curcol            Current column of point in current buffer.
  2907.  
  2908.   $curline           Current line of point in current buffer.
  2909.  
  2910.   $curwidth          Number of columns used currently.
  2911.  
  2912.   $curwind           Current window number.
  2913.  
  2914.   $cwline            Current display line in current window.
  2915.  
  2916.   $debug             Flag to trigger macro debugging.
  2917.  
  2918.   $deskcolor         Color to use for current desktop, default to BLACK.
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.                                                                                 50   MicroEMACS Procedures                                MicroEMACS Reference Manual
  2925.  
  2926.  
  2927.   $diagflag          If set to TRUE,  diagonal  dragging of text and mode lines is
  2928.                      enabled. If FALSE, text and  modelines  can  only  be dragged
  2929.                      horizontally or vertically at one time.
  2930.  
  2931.   $discmd            Controls the echoing of command prompts. Default is TRUE.
  2932.  
  2933.   $disinp            Controls the echoing of input at the command prompts. Default
  2934.                      is TRUE.
  2935.  
  2936.   $disphigh          If set to TRUE, high-bit characters  (single  byte characters
  2937.                      that are greater than 127 in value) will be  displayed  in  a
  2938.                      pseudo-control format. The characters "^!" will lead  off the
  2939.                      sequence, followed by the character stripped of its high bit.
  2940.                      Default is FALSE.
  2941.  
  2942.   $exbhook           This variable holds the name of a function or macro  which is
  2943.                      run whenever you are switching out of a buffer.
  2944.  
  2945.   $fcol              The current line position being displayed in the first column
  2946.                      of the current window.
  2947.  
  2948.   $fillcol           Current fill column.
  2949.  
  2950.   $flicker           Flicker Flag set to TRUE if IBM CGA  set  to  FALSE  for most
  2951.                      others.
  2952.  
  2953.   $fmtlead           lists   all   formatter   command  leadin  characters.  Lines
  2954.                      beginning  with  these  characters  will  be  considered  the
  2955.                      beginning of paragraphs.
  2956.  
  2957.   $gflags            Global  flags controlling some EMACS internal functions  (See
  2958.                      appendix G for details).
  2959.  
  2960.   $gmode             Global mode flags. (See Appendix F for values).
  2961.  
  2962.   $hardtab           Number of spaces between hard tab stops. Normally 8, this can
  2963.                      be used to change indentation only within the editor.
  2964.  
  2965.   $hjump             The number in here tells EMACS how many columns to scroll the
  2966.                      screen horizontally when a horizontal scroll is required.
  2967.  
  2968.   $hscroll           This flag  determines if EMACS will scroll the entire current
  2969.                      window horizontally, or just the  current  line.  The default
  2970.                      value, TRUE,  results  in  the  entire  current  window being
  2971.                      shifted left and right  when  the cursor goes off the edge of
  2972.                      the screen.
  2973.  
  2974.   $kill              This contains  the first 127 characters currently in the kill
  2975.                      buffer  and  can be used to set  the  contents  of  the  kill
  2976.                      buffer.
  2977.  
  2978.  
  2979.  
  2980.   51   MicroEMACS Reference Manual                                MicroEMACS Procedures
  2981.  
  2982.  
  2983.   $language          [READ  ONLY]Contains  the  name  of  the  language  which the
  2984.                      current  EMACS's  message  will  display. (Currently EMACS is
  2985.                      available in  English,  French,  Spanish,  Latin, Portuguese,
  2986.                      Dutch, German, and Pig Latin).
  2987.  
  2988.   $lastkey           [READ ONLY]Last keyboard character typed.
  2989.  
  2990.   $lastmesg          [READ ONLY]Contains  the text of the last message which emacs
  2991.                      wrote on the command line.
  2992.  
  2993.   $line              The current line in the current buffer can  be  retrieved and
  2994.                      set with this environment variable.
  2995.  
  2996.   $lterm             Character(s) to write as a  line  terminator  when  writing a
  2997.                      file to disk. Default is  null, which causes a '\n' character
  2998.                      to be written. Not all operating systems support this.
  2999.  
  3000.   $lwidth            [READ ONLY]Returns the number of  characters  in  the current
  3001.                      line.
  3002.  
  3003.   $match             [READ ONLY]Last string matched in a search.
  3004.  
  3005.   $modeflag          Determines if mode lines are currently displayed.
  3006.  
  3007.   $msflag            If TRUE, the mouse (if present) is active. If FALSE, no mouse
  3008.                      cursor is displayed, and no mouse actions are taken.
  3009.  
  3010.   $numwind           The number of windows displayed.
  3011.  
  3012.   $oldcrypt          Use the old  method  of  encryption  (which had a bug in it).
  3013.                      Default is FALSE.
  3014.  
  3015.   $orgrow            Desktop row position of current screen.
  3016.  
  3017.   $orgcol            Desktop column position of current screen.
  3018.  
  3019.   $pagelen           Number of screen lines used currently.
  3020.  
  3021.   $palette           string used  to  control  the  palette  register  settings on
  3022.                      graphics versions. The usually  form  consists  of  groups of
  3023.                      three octal digits setting the red, green, and blue levels.
  3024.  
  3025.   $paralead          Lists all paragraph start characters.
  3026.  
  3027.   $pending           [READ ONLY]Flag to determine  if  there  are  user keystrokes
  3028.                      waiting to be processed.
  3029.  
  3030.   $popflag           Use pop-up windows. Default is TRUE.
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.                                                                                 52   MicroEMACS Procedures                                MicroEMACS Reference Manual
  3037.  
  3038.  
  3039.   $progname          [READ  ONLY]Always  contains  the  string   "MicroEMACS"  for
  3040.                      standard MicroEMACS. Could  be  something  else  if  EMACS is
  3041.                      incorporated as part of someone else's program.
  3042.  
  3043.   $ram                The amount of  remaining  memory  if MicroEMACS was compiled
  3044.                      with RAMSIZE set. A debugging tool.
  3045.  
  3046.   $readhook          This  variable  holds  the  name  of  a  function to  execute
  3047.                      whenever  a  file  is read into EMACS.  Normally,  using  the
  3048.                      standard emacs.rc file, this is  bound  to  a  function which                              emacs.rc
  3049.                      places EMACS into CMODE if the extension of the file  read is
  3050.                      .c or .h.
  3051.  
  3052.   $region            Contains the string  of  the current region. It will truncate
  3053.                      at the stringsize limit, 255.
  3054.  
  3055.   $replace           Current default replace string.
  3056.  
  3057.   $rval              This contains the return value from the last subprocess which
  3058.                      was invoked from EMACS.
  3059.  
  3060.   $scrname           The current screen name.
  3061.  
  3062.   $search            Current default search string.
  3063.  
  3064.   $searchpnt         Set the placement of the of the cursor on a successful search
  3065.                      match. $searchpnt = 0 (the  default), causes the cursor to be
  3066.                      placed  at  the  end of the matched text on forward searches,
  3067.                      and  at  the  beginning  of  the  text  on reverse  searches.
  3068.                      $searchpnt  = 1 causes the cursor to be  placed  at  the  the
  3069.                      beginning  of  the  matched  text  regardless  of  the search
  3070.                      direction,  while  $searchpnt  = 2 causes the  cursor  to  be
  3071.                      placed at the end.
  3072.  
  3073.   $seed              Integer seed of the random number generator.
  3074.  
  3075.   $softtab           Number  of  spaces  inserted  by  EMACS  when  the handle-tab
  3076.                      command (which is normally bound to the TAB key) is invoked.
  3077.  
  3078.   $sres              Current screen resolution (CGA, MONO,  EGA or VGA on the IBM-
  3079.                      PC  driver.  LOW,  MEDIUM, HIGH or DENSE on the Atari ST1040,
  3080.                      NORMAL on most others).
  3081.  
  3082.   $ssave             If TRUE, when  EMACS  is  asked  to save the current file, it
  3083.                      writes  all  files  out  to  a  temporary  file, deletes  the
  3084.                      original,  and then renames the temporary  to  the  old  file
  3085.                      name. The default value of this is TRUE.
  3086.  
  3087.   $sscroll           Changes EMACS, when  set  to TRUE, to smoothly scroll windows
  3088.                      (one line  at  a  time)  when  cursoring  off the ends of the
  3089.                      current window.
  3090.  
  3091.  
  3092.   53   MicroEMACS Reference Manual                                MicroEMACS Procedures
  3093.  
  3094.  
  3095.   $status            [READ ONLY]Status of the success of the last command (TRUE or
  3096.                      FALSE).  This is usually used with !force  to  check  on  the
  3097.                      success of a search, or a file operation.
  3098.  
  3099.   $sterm             This is the character used to terminate search string inputs.
  3100.                      The default for this is the last key bound to meta-prefix.                                                                   ___________
  3101.  
  3102.   $target            Current target for line moves (setting this fool's EMACS into
  3103.                      believing the last command was a line move).
  3104.  
  3105.   $time              [READ  ONLY]Contains  a  string  corresponding to the current
  3106.                      date and time. Usually this is in a form similar to  "Mon May
  3107.                      09 10:10:58 1988". Not  all  operating  systems  will support
  3108.                      this.
  3109.  
  3110.   $tpause            Controls the length of the pause to display  a  matched fence
  3111.                      when the current  buffer  is  in  CMODE and a close fence has
  3112.                      been typed.
  3113.  
  3114.   $version           [READ ONLY]Contains the current MicroEMACS version number.
  3115.  
  3116.   $wchars            When  set, MicroEMACS uses the characters  listed  in  it  to
  3117.                      determine if it is in a word or not. If it  is  not  set (the
  3118.                      default), the characters it uses are the upper and lower case
  3119.                      letters, and the underscore.
  3120.  
  3121.   $wline             Number of display lines in current window.
  3122.  
  3123.   $wraphook          This variable contains the name of an EMACS function which is
  3124.                      executed when a  buffer  is  in  WRAP  mode and it is time to
  3125.                      wrap. By default this is bound to wrap-word.                                                       _________
  3126.  
  3127.   $writehook         This variable contains the name of an EMACS function or macro
  3128.                      which is invoked whenever EMACS  attempts to write a file out
  3129.                      to  disk.  This  is  executed  before  the  file is  written,
  3130.                      allowing you to process a file on the way out.
  3131.  
  3132.   $xpos              The column the mouse was at the last mouse button press.
  3133.  
  3134.   $yankflag          Controls the placement of the  cursor after a yank command or
  3135.                      an insert.  When $yankflag is FALSE (the default), the cursor
  3136.                      is placed at the end of the yanked or inserted text.  When it
  3137.                      is TRUE, the cursor remains at the start of the text.
  3138.  
  3139.   $ypos              The line which the mouse was on during the last  mouse button
  3140.                      press.
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.                                                                                 54   MicroEMACS Procedures                                MicroEMACS Reference Manual
  3149.  
  3150.  
  3151.  
  3152.   13.2.2  User variables  13.2.2  User variables
  3153.  
  3154.  
  3155.           User variables allow you  to  store  strings  and manipulate them. These
  3156.   strings can  be  pieces  of  text, numbers (in text form), or the logical values
  3157.   TRUE and FALSE. These variables can be combined, tested, inserted  into buffers,  TRUE     FALSE
  3158.   and otherwise used  to control the way your macros execute. At the moment, up to
  3159.   512  user  variables may be in use in one editing session.  All  users  variable
  3160.   names  must  begin  with  a  percent  sign  (%) and  may  contain  any  printing
  3161.   characters. Only the first 10  characters are significant (IE differences beyond
  3162.   the  tenth character are ignored). Most operators will  truncate  strings  to  a
  3163.   length of 128 characters.
  3164.  
  3165.  
  3166.   13.2.3  Buffer Variables  13.2.3  Buffer Variables
  3167.  
  3168.  
  3169.           Buffer variables are special in that they can only be queried and cannot
  3170.   be set. What buffer variables are is a way to take text from a buffer  and place
  3171.   it in a variable. For example, if I have a  buffer by the name of RIGEL2, and it
  3172.   contains the text:
  3173.  
  3174.           Richmond
  3175.           Lafayette
  3176.           <*>Bloomington          (where <*> is the current point)
  3177.           Indianapolis
  3178.           Gary
  3179.           =* MicroEMACS 3.11 (WRAP) == rigel2 == File: /data/rigel2.txt =====
  3180.  
  3181.           and within a command I reference #rigel2, like:
  3182.  
  3183.           insert-string #rigel2
  3184.  
  3185.           MicroEMACS would start  at  the  current  point in the RIGEL2 buffer and
  3186.   grab all the text up to the end of that  line  and pass that back. Then it would
  3187.   advance the point  to  the  beginning  of  the  next  line. Thus, after our last
  3188.   command  executes,  the  string  "Bloomington"  gets inserted into  the  current
  3189.   buffer, and the buffer RIGEL2 now looks like this:
  3190.  
  3191.           Richmond
  3192.           Lafayette
  3193.           Bloomington
  3194.           <*>Indianapolis         (where <*> is the current point)
  3195.           Gary
  3196.           =* MicroEMACS 3.11 (WRAP) == rigel2 == File: /data/rigel2.txt =====
  3197.  
  3198.           as you have probably  noticed,  a buffer variable consists of the buffer
  3199.   name, preceded by a pound sign (#).
  3200.  
  3201.  
  3202.  
  3203.  
  3204.   55   MicroEMACS Reference Manual                                MicroEMACS Procedures
  3205.  
  3206.  
  3207.  
  3208.   13.2.4  Interactive variables  13.2.4  Interactive variables
  3209.  
  3210.  
  3211.           Interactive variables are  actually  a  method  to prompt the user for a
  3212.   string. This  is  done  by  using  an  at sign (@) followed either with a quoted
  3213.   string, or a variable containing a string.  The  string  is  the  placed  on the
  3214.   bottom  line,  and the editor waits for the user to type in a string.  Then  the
  3215.   string  typed  in  by  the  users  is returned as the value of  the  interactive
  3216.   variable. For example:
  3217.  
  3218.           set %quest "What file? "
  3219.           find-file @%quest
  3220.  
  3221.           will ask the user for a file name,  and  then  attempt  to find it. Note
  3222.   also that complex expressions can be built up with these operators, such as:
  3223.  
  3224.   set %default "file1"
  3225.   @&cat &cat "File to decode[" %default "]: "
  3226.  
  3227.           which prompts the user with the string:
  3228.  
  3229.           File to decode[file1]:
  3230.  
  3231.   13.3  Functions  13.3  Functions
  3232.  
  3233.  
  3234.           Functions  can  be  used to act on variables in various ways.  Functions
  3235.   can have one, two, or three arguments. These  arguments  will  always  be placed
  3236.   after the  function  on  the  current command line. For example, if we wanted to
  3237.   increase the current fill column by two, using  emacs's  set  (^XA)  command, we
  3238.   would write:
  3239.  
  3240.           set $fillcol &add $fillcol 2
  3241.            \      \      \      \     \____second operand
  3242.             \      \      \      \_________first operand
  3243.              \      \      \_______________function to execute
  3244.               \      \_____________________variable to set
  3245.                \___________________________set (^XA) command
  3246.  
  3247.           Function  names  always  begin with the ampersand (&) character, and are
  3248.   only  significant  to  the first three characters after the ampersand. Functions
  3249.   will normal  expect  one  of  three  types  of arguments, and will automatically
  3250.   convert types when needed. Different argument types include:
  3251.  
  3252.   <num>              an ascii string of digits which is interpreted  as  a numeric
  3253.                      value.  Any string which does not start  with  a  digit  or a
  3254.                      minus sign (-) will be considered zero.
  3255.  
  3256.   <str>              An arbitrary string of characters. At the moment, strings are
  3257.                      limited to 128 characters in length.
  3258.  
  3259.  
  3260.                                                                                 56   MicroEMACS Procedures                                MicroEMACS Reference Manual
  3261.  
  3262.  
  3263.   <log>              A logical value  consisting  of the string "TRUE" or "FALSE".
  3264.                      Numeric strings will also evaluate  to  "FALSE"  if  they are
  3265.                      equal to zero, and "TRUE"  if  they  are  non-zero. Arbitrary
  3266.                      text strings will have the value of "FALSE".
  3267.  
  3268.           A  list  of  the currently available functions  follows.  Functions  are
  3269.   always used in lower case, the uppercase letters in the  function  table are the
  3270.   short form of the function (IE &div for ÷).
  3271.  
  3272.   Numeric Functions:      (returns <num>)
  3273.  
  3274.   &ADD            <num> <num>     Add two numbers
  3275.   &SUB            <num> <num>     Subtract the second number from the first
  3276.   &TIMes          <num> <num>     Multiply two numbers
  3277.   &DIVide         <num> <num>     Divide the first number by the second
  3278.                                   giving an integer result
  3279.   &MOD            <num> <num>     Return the reminder of dividing the
  3280.                                   first number by the second
  3281.   &NEGate         <neg>           Multiply the arg by -1
  3282.   &LENgth         <str>           Returns length of string
  3283.   &SINdex         <str1> <str2>   Finds the position of <str2> within
  3284.                                   <str1>. Returns zero if not found.
  3285.   &ASCii          <str>           Return the ascii code of the first
  3286.                                   character in <str>
  3287.   &RND            <num>           Returns a random integer between 1 and <num>
  3288.   &ABS            <num>           Returns the absolute value of <num>
  3289.   &BANd           <num> <num>     Bitwise AND function
  3290.   &BOR            <num> <num>     Bitwise OR function
  3291.   &BXOr           <num> <num>     Bitwise XOR function
  3292.   &BNOt           <num>           Bitwise NOT function
  3293.  
  3294.   String manipulation functions:  (returns <str>)
  3295.  
  3296.   &CAT            <str> <str>     Concatenate the two strings to form one
  3297.   &LEFt           <str> <num>     return the <num> leftmost characters
  3298.                                   from <str>
  3299.   &RIGht          <str> <num>     return the <num> rightmost characters
  3300.                                   from <str>
  3301.   &MID            <str> <num1> <num2>
  3302.                                   Starting from <num1> position in <str>,
  3303.                                   return <num2> characters.
  3304.   &UPPer          <str>           Uppercase <str>
  3305.   &LOWer          <str>           Lowercase <str>
  3306.   &CHR            <num>           return a string with the character
  3307.                                   represented by ascii code <num>
  3308.   >C                            returns a string of characters
  3309.                                   containing a EMACS command input from
  3310.                                   the user
  3311.   >K                            return a string containing a single
  3312.                                   keystroke from the user
  3313.   &ENV            <str>           If the operating system is capable, this
  3314.  
  3315.  
  3316.   57   MicroEMACS Reference Manual                                MicroEMACS Procedures
  3317.  
  3318.  
  3319.                                   returns the environment string associated
  3320.                                   with <str>
  3321.   &BIND           <str>           return the function name bound to the
  3322.                                   keystroke <str>
  3323.   &XLATE          <str1> <str2> <str3>
  3324.   &FINd           <str>           Find the named file <str> along the
  3325.                                   path and return its full file specification
  3326.                                   or an empty string if none exists
  3327.   &TRIM           <str>           Trim the trailing whitespace from a string
  3328.  
  3329.   Logical Testing functions:      (returns <log>)
  3330.  
  3331.   &NOT            <log>           Return the opposite logical value
  3332.   &AND            <log1> <log2>   Returns TRUE if BOTH logical arguments
  3333.                                   are TRUE
  3334.   &OR             <log1> <log2>   Returns TRUE if either argument
  3335.                                   is TRUE
  3336.   &EQUal          <num> <num>     If <num> and <num> are numerically
  3337.                                   equal, return TRUE
  3338.   &LESs           <num1> <num2>   If <num1> is less than <num2>, return
  3339.                                   TRUE.
  3340.   &GREater        <num1> <num2>   If <num1> is greater than, or equal to
  3341.                                   <num2>, return TRUE.
  3342.   &SEQual         <str1> <str2>   If the two strings are the same, return
  3343.                                   TRUE.
  3344.   &SLEss          <str1> <str2>   If <str1> is less alphabetically than
  3345.                                   <str2>, return TRUE.
  3346.   &SGReater       <str1> <str2>   If <str1> is alphabetically greater than
  3347.                                   or equal to <str2>, return TRUE.
  3348.   &EXIst          <str>           Does the named file <str> exist?
  3349.  
  3350.   &ISNum          <num>           Is the given argument a legitimate number?
  3351.  
  3352.   Special Functions:
  3353.  
  3354.   &GROup          <num>           Return group <num> as set by a MAGIC
  3355.                                   mode search.
  3356.  
  3357.   &SUPper         <str1> <str2>   Translate the first char in <str1> to
  3358.                                   the first char in <str2> when uppercasing.
  3359.  
  3360.   &SLOwer         <str1> <str2>   Translate the first char in <str1> to
  3361.                                   the first char in <str2> when lowercasing.
  3362.  
  3363.   &INDirect       <str>           Evaluate <str> as a variable.
  3364.  
  3365.           This  last  function  deserves  more  explanation.  The   &IND  function
  3366.   evaluates its argument, takes the  resulting  string,  and  then  uses  it  as a
  3367.   variable name. For example, given the following code sequence:
  3368.  
  3369.           ; set up reference table
  3370.  
  3371.  
  3372.                                                                                 58   MicroEMACS Procedures                                MicroEMACS Reference Manual
  3373.  
  3374.  
  3375.           set %one        "elephant"
  3376.           set %two        "giraffe"
  3377.           set %three      "donkey"
  3378.  
  3379.           set %index "two"
  3380.           insert-string &ind %index
  3381.  
  3382.           the  string  "giraffe" would have been inserted  at  the  point  in  the
  3383.   current buffer. This indirection can be safely nested up to about 10 levels.
  3384.  
  3385.   13.4  Directives  13.4  Directives
  3386.  
  3387.  
  3388.           Directives  are  commands  which  only  operate   within   an  executing
  3389.   procedure,  IE they do not make sense as a single command. As such, they  cannot
  3390.   be  called  up  singly or bound to keystroke. Used within  command  files,  they
  3391.   control what lines are executed and in what order.
  3392.  
  3393.           Directives always start with the exclamation mark (!) character and must
  3394.   be the first non-wite space placed on a line. Directives  executed interactively
  3395.   (via the execute-command-line command) will be ignored.
  3396.  
  3397.  
  3398.   13.4.1  !ENDM Directive  13.4.1  !ENDM Directive
  3399.  
  3400.  
  3401.           This directive is used  to  terminate a procedure or macro being stored.
  3402.   For example, if a file is being executed contains the text:
  3403.  
  3404.           ;       Read in a file in view mode, and make the window red
  3405.  
  3406.           store-procedure get-red-viewed-file
  3407.                   find-file @"File to view: "
  3408.                   add-mode "view"
  3409.                   add-mode "red"
  3410.           !endm
  3411.  
  3412.           print "[Consult procedure has been loaded]"
  3413.  
  3414.           only the lines between the store-macro command and  the  !ENDM directive
  3415.   are stored in  procedure  get-red-viewd-file. Both named procedures and numbered
  3416.   macroes (via the store-macro command) should be terminated with this directive.                   ___________
  3417.  
  3418.  
  3419.   13.4.2  !FORCE Directive  13.4.2  !FORCE Directive
  3420.  
  3421.  
  3422.           When  MicroEMACS  executes  a  procedure,  if  any  command  fails,  the
  3423.   procedure  is  terminated  at  that  point.  If a line is preceded by  a  !FORCE
  3424.   directive, execution continues whether the command succeeds or not. For example:
  3425.  
  3426.  
  3427.  
  3428.   59   MicroEMACS Reference Manual                                MicroEMACS Procedures
  3429.  
  3430.  
  3431.           ;       Merge the top two windows
  3432.  
  3433.           save-window             ;remember what window we are at
  3434.           1 next-window           ;go to the top window
  3435.           delete-window           ;merge it with the second window
  3436.           !force restore-window   ;This will continue regardless
  3437.           add-mode "red"
  3438.           Often this is used  together  with  the  $status environment variable to
  3439.   test if a command succeeded. For example:
  3440.  
  3441.           set %seekstring "String to Find: "
  3442.           !force search-forward %seekstring
  3443.           !if &seq $status TRUE
  3444.                   print "Your string is Found"
  3445.           !else
  3446.                   print "No such STRING!"
  3447.           !endif
  3448.  
  3449.  
  3450.   13.4.3  !IF, !ELSE, and !ENDIF Directives  13.4.3  !IF, !ELSE, and !ENDIF Directives
  3451.  
  3452.  
  3453.           This  directive allows statements only to be  executed  if  a  condition
  3454.   specified in the directive is met. Every line following the !IF directive, until
  3455.   the  first  !ELSE  or !ENDIF directive,  is  only  executed  if  the  expression
  3456.   following  the  !IF  directive evaluates to  a  TRUE  value.  For  example,  the
  3457.   following commands creates  the  portion  of  a  text  file  automatically. (yes
  3458.   believe me, this will be easier to understand then that last explanation....)
  3459.  
  3460.           !if &sequal %curplace "timespace vortex"
  3461.                   insert-string "First, rematerialize~n"
  3462.           !endif
  3463.           !if &sequal %planet "earth"     ;If we have landed on earth...
  3464.                   !if &sequal %time "late 20th century"  ;and we are then
  3465.                           write-message "Contact U.N.I.T."
  3466.                   !else
  3467.                           insert-string "Investigate the situation....~n"
  3468.                           insert-string "(SAY 'stay here Sara')~n"
  3469.                   !endif
  3470.           !else
  3471.                   set %conditions @"Atmosphere conditions outside? "
  3472.                   !if &sequal %conditions "safe"
  3473.                           insert-string &cat "Go outside......" "~n"
  3474.                           insert-string "lock the door~n"
  3475.                   !else
  3476.                           insert-string "Dematerialize..try somewhen else"
  3477.                           newline
  3478.                   !endif
  3479.           !endif
  3480.  
  3481.  
  3482.  
  3483.  
  3484.                                                                                 60   MicroEMACS Procedures                                MicroEMACS Reference Manual
  3485.  
  3486.  
  3487.  
  3488.   13.4.4  !GOTO Directive  13.4.4  !GOTO Directive
  3489.  
  3490.  
  3491.           Flow can be controlled  within  a  MicroEMACS  procedure using the !GOTO
  3492.   directive. It takes  as an argument a label. A label consists of a line starting
  3493.   with  an  asterisk  (*) and then an  alphanumeric  label.  Only  labels  in  the
  3494.   currently executing  procedure  can  be  jumped to, and trying to jump to a non-
  3495.   existing label terminates execution of a procedure. For example:
  3496.  
  3497.           ;Create a block of DATA statements for a BASIC program
  3498.  
  3499.                   insert-string "1000 DATA "
  3500.                   set %linenum 1000
  3501.  
  3502.           *nxtin
  3503.                   update-screen           ;make sure we see the changes
  3504.                   set %data @"Next number: "
  3505.                   !if &equal %data 0
  3506.                           !goto finish
  3507.                   !endif
  3508.  
  3509.                   !if &greater $curcol 60
  3510.                           2 delete-previous-character
  3511.                           newline
  3512.                           set %linenum &add %linenum 10
  3513.                           insert-string &cat %linenum " DATA "
  3514.                   !endif
  3515.  
  3516.                   insert-string &cat %data ", "
  3517.                   !goto nxtin
  3518.  
  3519.           *finish
  3520.  
  3521.                   2 delete-previous-character
  3522.                   newline
  3523.  
  3524.  
  3525.   13.4.5  !WHILE and !ENDWHILE Directives  13.4.5  !WHILE and !ENDWHILE Directives
  3526.  
  3527.  
  3528.           This  directive  allows  you  to  set  up  repetitive tasks  easily  and
  3529.   efficiently. If a group of  statements  need  to  be  executed  while  a certain
  3530.   condition is true, enclose them with a while loop. For example,
  3531.  
  3532.           !while &less $curcol 70
  3533.                   insert-string &cat &cat "[" #stuff "]"
  3534.           !endwhile
  3535.  
  3536.           places items from buffer "item" in the current line until the  cursor is
  3537.   at or past column 70. While loops may be nested  and  can  contain  and  be  the
  3538.  
  3539.  
  3540.   61   MicroEMACS Reference Manual                                MicroEMACS Procedures
  3541.  
  3542.  
  3543.   targets of !GOTOs  with no ill effects. Using a while loop to enclose a repeated
  3544.   task will run much faster than the corresponding construct using !IFs.
  3545.  
  3546.  
  3547.   13.4.6  !BREAK Directive  13.4.6  !BREAK Directive
  3548.  
  3549.  
  3550.           This  lets you abort out of the most  executing  currently  inner  while
  3551.   loop, regardless of  the  condition.  It  is  often used to abort processing for
  3552.   error conditions. For example:
  3553.  
  3554.   ;       Read in files and substitute "begining" with "beginning"
  3555.  
  3556.           set %filename #list
  3557.           !while ¬ &seq %filename "<end>"
  3558.   !force          find-file %filename
  3559.                   !if &seq $status FALSE
  3560.                           write-message "[File read error]"
  3561.                           !break
  3562.                   !endif
  3563.                   beginning-of-file
  3564.                   replace-string "begining" "beginning"
  3565.                   save-file
  3566.                   set %filename #list
  3567.           !endwhile
  3568.  
  3569.           This while loop will process files until the list is exhausted  or there
  3570.   is an error while reading a file.
  3571.  
  3572.  
  3573.   13.4.7  !RETURN Directive  13.4.7  !RETURN Directive
  3574.  
  3575.  
  3576.           The  !RETURN  Directive  causes the current procedure  to  exit,  either
  3577.   returning to the caller (if any) or to interactive mode. For example:
  3578.  
  3579.           ;       Check the monitor type and set %mtyp
  3580.  
  3581.           !if &sres "CGA"
  3582.                   set %mtyp 1
  3583.                   !return
  3584.           !else
  3585.                   set %mtyp 2
  3586.           !endif
  3587.  
  3588.           insert-string "You are on a MONOCHROME machine!~n"
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.                                                                                 62   Debugging MicroEMACS Procedures                      MicroEMACS Reference Manual
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.                                      Chapter 14                                     Chapter 14
  3604.  
  3605.                           Debugging MicroEMACS Procedures                          Debugging MicroEMACS Procedures
  3606.  
  3607.  
  3608.           When  developing new procedures, it is very convenient  to  be  able  to
  3609.   trace  their  execution  to  discover  errors. The $debug  environment  variable
  3610.   enables procedure debugging.  While  this  variable  is TRUE, emacs will stop at
  3611.   each line it intends to execute and allow you to view it, and issue a  number of
  3612.   different commands to help determine how the procedure is executing.
  3613.  
  3614.           For example, we  will  step  through  the  procedure  which  toggles the
  3615.   function key window off. The  first thing to do, is to set $debug, using the ^XA                                                                               ^XA
  3616.   set  command.  Type  ^XA  and  emacs  will prompt you on the command  line  with  ___
  3617.   "Variable  to set: ". Type in "$debug" and press the enter key. Emacs will  then
  3618.   ask "Value: ". Type in "TRUE" (in capital letters) and press the enter key.
  3619.  
  3620.           While macro debugging is enabled (as  it  is now) emacs will report each
  3621.   time a variable is assigned a value, by displaying the variable and its value on
  3622.   the command line. Right now,
  3623.  
  3624.   ((($debug <- TRUE)))
  3625.  
  3626.           appears  on  the  command  line  to  tell  you that $debug now has  been
  3627.   assigned the value of TRUE. Press the space bar to continue.
  3628.  
  3629.           Now, lets try  to  debug  a  macro.  Press function key 5 which normally
  3630.   toggles the function key window. The first thing that appears is:
  3631.  
  3632.   <<<[Macro 01]:!if %rcfkeys>>>
  3633.  
  3634.           At this point,  emacs is waiting for a command. It is prepared to see if
  3635.   the  user variable %rcfkeys is TRUE, and execute some lines if they are. Suppose
  3636.   we  want  to  see the value of this variable, type the letter "e" to evaluate an
  3637.   expression. Emacs will prompt with "EXP: ".   Type  "%rcfkeys"  followed  by the
  3638.   enter key. Emacs should then respond  with  "TRUE" to indicate that the function
  3639.   key window is currently on screen.
  3640.  
  3641.           Press the space bar to allow the !if directive to  execute.   Emacs will
  3642.   decide that it is TRUE, and then display the next command to execute.
  3643.  
  3644.   <<<[Macro 01]:!goto rcfoff>>>
  3645.  
  3646.           Notice emacs tells us what procedure we are currently executing (in this
  3647.   case, the macro bound to execute-macro-1). Press the space bar again  to execute
  3648.   the !goto directive.
  3649.  
  3650.  
  3651.  
  3652.   63   MicroEMACS Reference Manual                      Debugging MicroEMACS Procedures
  3653.  
  3654.  
  3655.   <<<[Macro 01]:save-window>>>
  3656.  
  3657.           Emacs is saving the position  of  the  current  window  so  that  it can
  3658.   attempt to return to it after it has brought up the function key window.
  3659.  
  3660.           [...THIS CHAPTER IS NOT FINISHED...]
  3661.  
  3662.  
  3663.  
  3664.  
  3665.  
  3666.  
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.                                                                                 64   Key Bindings, What they are and why                  MicroEMACS Reference Manual
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.                                      Chapter 15                                     Chapter 15
  3716.  
  3717.                         Key Bindings, What they are and why                        Key Bindings, What they are and why
  3718.  
  3719.  
  3720.           One of the features which makes MicroEMACS very adaptable is its ability
  3721.   to use different  keystrokes  to  execute  different  commands.  The  process of
  3722.   changing the particular command  a  key invokes is called rebinding. This allows                                                            _________
  3723.   us to make the editor look like other popular editors and programs.
  3724.  
  3725.           Each  command  in  MicroEMACS has a  name  which  is  used  for  binding
  3726.   purposes. For example, the command to  move  the  cursor down one page is called
  3727.   next-line and is normally bound  to  the  ^N  key.  If you decided that you also  _________
  3728.   wanted to use the ^D key to move the cursor down one line, you would use the M-K
  3729.   bind-to-key command. EMACS would respond with ": bind-to-key "  on  the  command  ___________
  3730.   line and allow you to type in a command name.  Then  type  in  the  name  of the
  3731.   command   you want to change, in this case next-line, followed by the <NL>  key.                                             _________
  3732.   EMACS will then wait for you to type in the keys you want to activate  the named
  3733.   function. Type a single ^D. From now on, typing ^D will cause EMACS to move down
  3734.   one line, rather than its original function of deleting characters.
  3735.  
  3736.           To find out the name of a  command,  consult  the  list  of  valid EMACS
  3737.   commands in Appendix B. Also, you can use the ^X?  describe-key  command to look                                                     ____________
  3738.   up the name of a command. Type ^X? and then the key  to  use  that  command, and
  3739.   EMACS will show you the name of the command.
  3740.  
  3741.           After you have experimented  with  changing  your  key bindings, you may
  3742.   decide that you want to change  some  bindings permanently. To have EMACS rebind
  3743.   keys  to your pleasure each time you start EMACS, you can add statements to  the
  3744.   end of your startup file (emacs.rc or .emacsrc  depending  on  the  system). For                            emacs.rc    .emacsrc
  3745.   example,
  3746.  
  3747.           bind-to-key next-line ^D
  3748.  
  3749.           Notice,  that control D character in the  startup  file  is  represented
  3750.   visibly as an uparrow key  followed by a capital D. To know how to represent any
  3751.   keys you want to bind,  use  the  describe-key  command  on the key, and use the                                    ____________
  3752.   sequence that is displayed.
  3753.  
  3754.           bind-to-key split-current-window FN1
  3755.  
  3756.           This example would make function key 1 activate the command  that splits
  3757.   the current window in two.
  3758.  
  3759.           EMACS will let you define  a  large  number  of  keys,  but  will report
  3760.   "Binding table FULL!" when it runs out of space to bind  keys.  Normally   EMACS
  3761.  
  3762.  
  3763.  
  3764.   65   MicroEMACS Reference Manual                  Key Bindings, What they are and why
  3765.  
  3766.  
  3767.   will  allow  up  to 512 key bindings (including approx. 300  originally    bound
  3768.   keys).
  3769.  
  3770.           If you want to get a current listing of all the  commands  and  the keys
  3771.   bound to them, use  the  describe-bindings command. Notice, that this command is                           _________________
  3772.   not bound to any keys!
  3773.  
  3774.  
  3775.  
  3776.  
  3777.  
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.                                                                                 66   MicroEMACS Command Line Switches and Startup Files   MicroEMACS Reference Manual
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.                                      Appendix A                                     Appendix A
  3828.  
  3829.                  MicroEMACS Command Line Switches and Startup Files                 MicroEMACS Command Line Switches and Startup Files
  3830.  
  3831.  
  3832.           When  EMACS  first  executes, it always  searches  for  a  file,  called
  3833.   .emacsrc under most UNIX systems or emacs.rc on most other systems which it will  .emacsrc _____ ____ ____ _______    emacs.rc __ ____ _____ _______
  3834.   execute as  EMACS  macros  before  it reads in the named source files. This file
  3835.   normally contains EMACS macroes to bind the function keys  to  useful  functions
  3836.   and load various useful macros. The contents of  this  file  will  probably vary
  3837.   from system to system and can be modified by the user as desired.
  3838.  
  3839.           When  searching for this file, EMACS looks for it in this order.  First,
  3840.   it attempts to  find a definition for "HOME" in the environment. It will look in                                         HOME
  3841.   that directory first. Then it searches all the directories listed in  the "PATH"                                                                             PATH
  3842.   environment variable. Then  it  looks  through  a  list  of  predefined standard
  3843.   directories which vary from system to system. Finally, failing all of  these, it
  3844.   looks in the  current directory. This is also the same method EMACS uses to look
  3845.   up any files to execute, and to find it's help file EMACS.HLP.                                                      EMACS.HLP
  3846.  
  3847.           On computers that  call  up  EMACS  via  a command line process, such as
  3848.   MSDOS and UNIX, there are different things that can be added to the command line
  3849.   to control the way EMACS operates. These can be switches, which are a dash ('-')
  3850.   followed  by  a  letter,  and  possible  other  parameters,  or  a startup  file
  3851.   specifier, which is an at sign '@' followed by a file name.
  3852.  
  3853.   @<file>            This  causes the named file to be  executed  instead  of  the
  3854.                      standard emacs.rc file before emacs reads in any other files.
  3855.                      More than one of these can be placed on the command line, and
  3856.                      they will be executed in the order that they appear.
  3857.  
  3858.   -C                 The following source files on the command line can be changed
  3859.                      (as opposed to being in VIEW mode). This is  mainly  used  to
  3860.                      cancel  the  effects  of the -v switch used previously in the
  3861.                      same command line.
  3862.  
  3863.   -E                 This flag  causes emacs to automatically run the startup file
  3864.                      "error.cmd" instead of emacs.rc.  This  is  used by various C
  3865.                      compilers for error processing  (for  example,  Mark Williams
  3866.                      C).
  3867.  
  3868.   -G<num>            Upon entering EMACS, position the cursor at the <num> line of
  3869.                      the first file.
  3870.  
  3871.   -I<var> <value>    Initialize an EMACS variable with <value>. This can be useful
  3872.                      to force EMACS to start in a particular  mode.  (For example,
  3873.  
  3874.  
  3875.  
  3876.   67   MicroEMACS Reference Manual   MicroEMACS Command Line Switches and Startup Files
  3877.  
  3878.  
  3879.                      invoke EMACS with "emacs  -i$sres  VGA  foo.bar" to edit file
  3880.                      foo.bar in VGA 50 line mode on an IBM-PC).
  3881.  
  3882.   -K<key>            This key tells emacs to place the source files in  CRYPT mode
  3883.                      and read it in using <key>  as  the encryption key. If no key
  3884.                      is listed  immediately after the -K switch, EMACS will prompt
  3885.                      for a key, and not echo it as it is typed.
  3886.  
  3887.   -R                 This places EMACS in  "restricted  mode"  where  any commands
  3888.                      allowing the user to  read  or write any files other than the
  3889.                      ones  listed  on  the  command  line are disabled.  Also  all
  3890.                      commands allowing the user access to the operating system are
  3891.                      disabled.  This  makes  EMACS  very   useful   as   a  "safe"
  3892.                      environment for use  within other applications and especially
  3893.                      used  as a remote editor for a  BBS  or  electronic  bulletin
  3894.                      board system.
  3895.  
  3896.   -S<string>         After  EMACS  is   started,  it  automatically  searches  for
  3897.                      <string> in the first source file.
  3898.  
  3899.   -V                 This tells EMACS that all  the following sources files on the
  3900.                      command  line  should  be in VIEW mode to prevent any changes
  3901.                      being made to them.
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.                                                                                 68   Command Completion                                   MicroEMACS Reference Manual
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.                                      Appendix B                                     Appendix B
  3940.  
  3941.                                  Command Completion                                 Command Completion
  3942.  
  3943.  
  3944.           Some versions of MicroEMACS will  allow you to abbrieviate buffer names,
  3945.   command names and  file  names as you enter them. To use this, type in the first
  3946.   few characters of the name you wish, and then hit either the space bar, the META
  3947.   key or the TAB key. MicroEMACS will then attempt to look at the list of  all the
  3948.   availible names and if there is only one  which  will  fit,  it will choose that
  3949.   name. If there are several names that quailify, as many characters as are common
  3950.   to ALL of them will  be entered. If there are no possible matches, the bell will
  3951.   ring to indicate MicroEMACS can not complete the command.
  3952.  
  3953.           For example, if you have several files in your  current  directory  with
  3954.   the following names:
  3955.  
  3956.           prog1.c
  3957.           prog1.obj
  3958.           prog1.exe
  3959.           prog1.doc
  3960.           program.one
  3961.           project.one
  3962.           test.c
  3963.           tes
  3964.  
  3965.           and you enter the ^X^F find-file command, if you type  'p'  and then hit                            ^X^F _________
  3966.   the  space  bar,  EMACS will respond by typing the 'r' that is common to all the
  3967.   above file names begining with  'p'. If you then type 'ogr' and hit the tab key,
  3968.   EMACS will respond with 'am.one' and automatically hit the enter key for you.
  3969.  
  3970.           If you were to instead type an 'a'  and  hit  the  space bar, EMACS will
  3971.   beep, informing you that there is no possible match.
  3972.  
  3973.           If you  type  a  'te'  and  hit  the space bar, EMACS will then type the
  3974.   following 's', but it will not automatically enter it because it is possible you
  3975.   mean to get to the test.c file.
  3976.  
  3977.           Buffer name, and command name completion is available in all versions of
  3978.   MicroEMACS. File name completion is available on UNIX BSD4.3, the Atari  ST, the
  3979.   AMIGA and under MSDOS.
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.   69   MicroEMACS Reference Manual                                  MicroEMACS Commands
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.                                      Appendix C                                     Appendix C
  3996.  
  3997.                                 MicroEMACS Commands                                MicroEMACS Commands
  3998.  
  3999.  
  4000.           Below is a complete list of the commands  in  EMACS,  the  keys normally
  4001.   used to do the command, and what the command does.  Remember,  on some computers
  4002.   there may also be additional ways  of  using  a command (cursor keys and special
  4003.   function keys for example).
  4004.  
  4005.   Command                         Binding         Meaning  _______                         _______         _______
  4006.   abort-command            ^G     This allows the user to abort out of any
  4007.                                   command that is waiting for input
  4008.  
  4009.   add-mode                 ^XM    Add a mode to the current buffer
  4010.  
  4011.   add-global-mode          M-M    Add a global mode for all new buffers
  4012.  
  4013.   append-file              ^X^A   Write a buffer to the end of a file
  4014.  
  4015.   apropos                  M-A    List out commands whose name contains
  4016.                                   the string specified
  4017.  
  4018.   backward-character       ^B     Move one character to the left
  4019.  
  4020.   begin-macro              ^X(    Begin recording a keyboard macro
  4021.  
  4022.   beginning-of-file        M-<    Move to the beginning of the file in
  4023.                                   the current buffer
  4024.  
  4025.   beginning-of-line        ^A     Move to the beginning of the current line
  4026.  
  4027.   bind-to-key              M-K    Bind a key to a function
  4028.  
  4029.   buffer-position          ^X=    List the position of the cursor in the
  4030.                                   current window on the command line
  4031.  
  4032.   case-region-lower        ^X^L   Make a marked region all lower case
  4033.  
  4034.   case-region-upper        ^X^U   Make a marked region all upper case
  4035.  
  4036.   case-word-capitalize     M-C    Capitalize the following word
  4037.  
  4038.   case-word-lower          M-L    Lower case the following word
  4039.  
  4040.   case-word-upper          M-U    Upper case the following word
  4041.  
  4042.  
  4043.  
  4044.                                                                                 70   MicroEMACS Commands                                  MicroEMACS Reference Manual
  4045.  
  4046.  
  4047.   change-file-name         ^XN    Change the name of the file in the
  4048.                                   current buffer
  4049.  
  4050.   change-screen-size      (none)  Change the number of lines of the screen
  4051.                                   currently being used
  4052.  
  4053.   change-screen-width     (none)  Change the number of columns of the
  4054.                                   screen currently being used
  4055.  
  4056.   clear-and-redraw         ^L     Clear the physical screen and redraw it
  4057.  
  4058.   clear-message-line      (none)  Clear the command line
  4059.  
  4060.   copy-region              M-W    Copy the currently marked region into
  4061.                                   the kill buffer
  4062.  
  4063.   count-words              M-^C   Count how many words, lines and
  4064.                                   characters are in the current marked region
  4065.  
  4066.   ctlx-prefix              ^X     Change the key used as the ^X prefix
  4067.  
  4068.   cycle-screens            A-C    Bring the rearmost screen to front
  4069.  
  4070.   delete-blank-lines       ^X^O   Delete all blank lines around the cursor
  4071.  
  4072.   delete-buffer            ^XK    Delete a buffer which is not being
  4073.                                   currently displayed in a window
  4074.  
  4075.   delete-mode              ^X^M   Turn off a mode in the current buffer
  4076.  
  4077.   delete-global-mode       M-^M   Turn off a global mode
  4078.  
  4079.   delete-next-character    ^D     Delete the character following the cursor
  4080.  
  4081.   delete-next-word         M-D    Delete the word following the cursor
  4082.  
  4083.   delete-other-windows     ^X1    Make the current window cover the entire
  4084.                                   screen
  4085.  
  4086.   delete-previous-character^H     Delete the character to the left of the
  4087.                                   cursor
  4088.  
  4089.   delete-previous-word     M-^H   Delete the word to the left of the cursor
  4090.  
  4091.   delete-screen            A-D    Delete a screen
  4092.  
  4093.   delete-window            ^X0    Remove the current window from the screen
  4094.  
  4095.   describe-bindings       (none)  Make a list of all legal commands
  4096.  
  4097.   describe-functions      (none)  Make a list of all legal functions
  4098.  
  4099.  
  4100.   71   MicroEMACS Reference Manual                                  MicroEMACS Commands
  4101.  
  4102.  
  4103.   describe-variables      (none)  Make a list of all environment
  4104.                                   and user variables
  4105.  
  4106.   describe-key             ^X?    Describe what command is bound to a
  4107.                                   keystroke sequence
  4108.  
  4109.   detab-region             ^X^D   Change all tabs in a region to the
  4110.                                   equivalent spaces
  4111.  
  4112.   display                 ^XG     Prompts the user for a variable and
  4113.                                   displays its current value
  4114.  
  4115.   dump-variables           none   Places into a buffer the current values
  4116.                                   of all environment and user variables
  4117.  
  4118.   end-macro                ^X)    stop recording a keyboard macro
  4119.  
  4120.   end-of-file              M->    Move cursor to the end of the current buffer
  4121.  
  4122.   end-of-line              ^E     Move to the end of the current line
  4123.  
  4124.   end-of-word             (none)  Move the point just past the end of
  4125.                                   the current word
  4126.  
  4127.   entab-region             ^X^E   Change multiple spaces to tabs where
  4128.                                   possible
  4129.  
  4130.   exchange-point-and-mark  ^X^X   Move cursor to the last marked spot,
  4131.                                   make the original position be marked
  4132.  
  4133.   execute-buffer          (none)  Execute a buffer as a macro
  4134.  
  4135.   execute-command-line    (none)  Execute a line typed on the command
  4136.                                   line as a macro command
  4137.  
  4138.   execute-file            (none)  Execute a file as a macro
  4139.  
  4140.   execute-macro            ^XE    Execute the keyboard macro (play back
  4141.                                   the recorded keystrokes)
  4142.   execute-macro-<n>       (none)  Execute numbered macro <N> where <N> is
  4143.                                   an integer from 1 to 40
  4144.  
  4145.   execute-named-command    M-X    Execute a command by name
  4146.  
  4147.   execute-procedure        M-^E   Execute a procedure by name
  4148.  
  4149.   execute-program         ^X$     Execute a program directly (not through
  4150.                                   an intervening shell)
  4151.  
  4152.   exit-emacs               ^X^C   Exit EMACS. If there are unwritten,
  4153.                                   changed buffers EMACS will ask to confirm
  4154.  
  4155.  
  4156.                                                                                 72   MicroEMACS Commands                                  MicroEMACS Reference Manual
  4157.  
  4158.  
  4159.   fill-paragraph           M-Q    Fill the current paragraph
  4160.  
  4161.   filter-buffer            ^X#    Filter the current buffer through an
  4162.                                   external filter
  4163.  
  4164.   find-file                ^X^F   Find a file to edit in the current window
  4165.  
  4166.   find-screen              A-F    Bring the named screen to front,
  4167.                                   creating it if needed
  4168.  
  4169.   forward-character        ^F     Move cursor one character to the right
  4170.  
  4171.   goto-line                M-G    Goto a numbered line
  4172.  
  4173.   goto-mark                M-^G   Goto a numbered mark
  4174.  
  4175.   goto-matching-fence      M-^F   Goto the matching fence
  4176.  
  4177.   grow-window              ^X^    Make the current window larger
  4178.  
  4179.   handle-tab               ^I     Insert a tab or set tab stops
  4180.  
  4181.   hunt-forward             A-S    Hunt for the next match of the last
  4182.                                   search string
  4183.  
  4184.   hunt-backward            A-R    Hunt for the last match of the last
  4185.                                   search string
  4186.  
  4187.   help                     M-?    Read EMACS.HLP into a buffer and display it
  4188.  
  4189.   i-shell                  ^XC    Shell up to a new command processor
  4190.  
  4191.   incremental-search       ^XS    Search for a string, incrementally
  4192.  
  4193.   indent-region            M-(    Indent the current region one tab
  4194.  
  4195.   insert-file              ^X^I   insert a file at the cursor in the
  4196.                                   current file
  4197.  
  4198.   insert-space             ^C     Insert a space to the right of the cursor
  4199.  
  4200.   insert-string           (none)  Insert a string at the cursor
  4201.  
  4202.   kill-paragraph           M-^W   Delete the current paragraph
  4203.  
  4204.   kill-region              ^W     Delete the current marked region, moving
  4205.                                   it to the kill buffer
  4206.  
  4207.   kill-to-end-of-line      ^K     Delete the rest of the current line
  4208.  
  4209.   label-function-key      (none)  Set the text on a function key label
  4210.  
  4211.  
  4212.   73   MicroEMACS Reference Manual                                  MicroEMACS Commands
  4213.  
  4214.  
  4215.                                   (HP150 only)
  4216.  
  4217.   list-buffers             ^X^B   List all existing buffers
  4218.  
  4219.   list-screens             A-B    List all existing screens
  4220.  
  4221.   macro-to-key             M-^K   Bind a key to a macro
  4222.  
  4223.   meta-prefix              <ESC>  Key used to precede all META commands
  4224.  
  4225.   mouse-move-down          MSa
  4226.  
  4227.   mouse-move-up            MSb
  4228.  
  4229.   mouse-resize-screen      MS1
  4230.  
  4231.   mouse-region-down        MSe
  4232.  
  4233.   mouse-region-up          MSf
  4234.  
  4235.   move-window-down         ^X^N   Move all the lines in the current window down
  4236.  
  4237.   move-window-up           ^X^P   Move all the lines in the current window up
  4238.  
  4239.   name-buffer              M-^N   Change the name of the current buffer
  4240.  
  4241.   narrow-to-region         ^X<    hides all text not in the current region
  4242.  
  4243.   newline                  ^M     Insert a <NL> at the cursor
  4244.  
  4245.   newline-and-indent       ^J     Insert a <NL> at the cursor and indent
  4246.                                   the new line the same as the preceding line
  4247.  
  4248.   next-buffer              ^XX    Bring the next buffer in the list into
  4249.                                   the current window
  4250.  
  4251.   next-line                ^N     Move the cursor down one line
  4252.  
  4253.   next-page                ^V     Move the cursor down one page
  4254.  
  4255.   next-paragraph           M-N    Move cursor to the next paragraph
  4256.  
  4257.   next-window              ^XO    Move cursor to the next window
  4258.  
  4259.   next-word                M-F    Move cursor to the beginning of the
  4260.                                   next word
  4261.  
  4262.   nop                     (none)  Does nothing
  4263.  
  4264.   open-line                ^O     Open a line at the cursor
  4265.  
  4266.  
  4267.  
  4268.                                                                                 74   MicroEMACS Commands                                  MicroEMACS Reference Manual
  4269.  
  4270.  
  4271.   overwrite-string        (none)  Overwrite a string at the cursor
  4272.  
  4273.   pipe-command             ^X@    Execute an external command and place
  4274.                                   its output in a buffer
  4275.  
  4276.   pop-buffer              (none)  Display a buffer temporarily, paging
  4277.  
  4278.   previous-line            ^P     Move cursor up one line
  4279.  
  4280.   previous-page            ^Z     Move cursor up one page
  4281.  
  4282.   previous-paragraph       M-P    Move back one paragraph
  4283.  
  4284.   previous-window          ^XP    Move the cursor to the last window
  4285.  
  4286.   previous-word            M-B    Move the cursor to the beginning of the
  4287.                                   word to the left of the cursor
  4288.  
  4289.   print                   (none)  Display a string on the command line
  4290.                                   (a synonim to write-message)
  4291.  
  4292.   query-replace-string     M-^R   Replace all of one string with another
  4293.                                   string, interactively querying the user
  4294.  
  4295.   quick-exit               M-Z    Exit EMACS, writing out all changed buffers
  4296.  
  4297.   quote-character          ^Q     Insert the next character literally
  4298.  
  4299.   read-file                ^X^R   Read a file into the current buffer
  4300.  
  4301.   redraw-display           M-^L   Redraw the display, centering the
  4302.                                   current line
  4303.  
  4304.   remove-mark             (none)  Remove a numbered mark
  4305.  
  4306.   resize-window            ^XW    Change the number of lines in the
  4307.                                   current window
  4308.  
  4309.   restore-window          (none)  Move cursor to the last saved window
  4310.  
  4311.   replace-string           M-R    Replace all occurrences of one string
  4312.                                   with another string from the cursor
  4313.                                   to the end of the buffer
  4314.  
  4315.   reverse-incremental-search^XR   Search backwards, incrementally
  4316.  
  4317.   run                      M-^E   Execute a named procedure
  4318.  
  4319.   save-file                ^X^S   Save the current buffer if it is changed
  4320.  
  4321.   save-window             (none)  Remember current window (to restore later)
  4322.  
  4323.  
  4324.   75   MicroEMACS Reference Manual                                  MicroEMACS Commands
  4325.  
  4326.  
  4327.   scroll-next-up           M-^Z   Scroll the next window up
  4328.  
  4329.   scroll-next-down         M-^V   Scroll the next window down
  4330.  
  4331.   search-forward           ^S     Search for a string
  4332.  
  4333.   search-reverse           ^R     Search backwards for a string
  4334.  
  4335.   select-buffer            ^XB    Select a buffer to display in the
  4336.                                   current window
  4337.  
  4338.   set                      ^XA    Set a variable to a value
  4339.  
  4340.   set-encryption-key       M-E    Set the encryption key of the current buffer
  4341.  
  4342.   set-fill-column          ^XF    Set the current fill column
  4343.  
  4344.   set-mark                        Set the mark
  4345.  
  4346.   shell-command            ^X!    Causes an external shell to execute
  4347.                                   a command
  4348.  
  4349.   show-files              (none)  Pop up a list of files from the
  4350.                                   specified directory
  4351.  
  4352.   shrink-window            ^X^Z   Make the current window smaller
  4353.  
  4354.   source                  (none)  Execute a file as a macro
  4355.  
  4356.   split-current-window     ^X2    Split the current window in two
  4357.  
  4358.   store-macro             (none)  Store the following macro lines to a
  4359.                                   numbered macro
  4360.  
  4361.   store-procedure         (none)  Store the following macro lines to a
  4362.                                   named procedure
  4363.  
  4364.   transpose-characters     ^T     Transpose the character at the cursor
  4365.                                   with the character to the left
  4366.  
  4367.   trim-region              ^X^T   Trim any trailing white space from a region
  4368.  
  4369.   unbind-key               M-^K   Unbind a key from a function
  4370.  
  4371.   undent-region            M-)    Remove a leading indent from a region
  4372.  
  4373.   universal-argument       ^U     Execute the following command 4 times
  4374.  
  4375.   unmark-buffer            M-~    Unmark the current buffer (so it is
  4376.                                   no longer changed)
  4377.  
  4378.  
  4379.  
  4380.                                                                                 76   MicroEMACS Commands                                  MicroEMACS Reference Manual
  4381.  
  4382.  
  4383.   update-screen           (none)  Force a screen update during macro execution
  4384.  
  4385.   view-file                ^X^V   Find a file,and put it in view mode
  4386.  
  4387.   widen-from-region        ^X>    restores hidden text (see narrow-to-region)
  4388.  
  4389.   wrap-word               (none)  Wrap the current word, this is an
  4390.                                   internal function
  4391.  
  4392.   write-file               ^X^W   Write the current buffer under a new
  4393.                                   file name
  4394.  
  4395.   write-message           (none)  Display a string on the command line
  4396.  
  4397.   yank                     ^Y     yank the kill buffer into the current
  4398.                                   buffer at the cursor
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432.  
  4433.  
  4434.  
  4435.  
  4436.   77   MicroEMACS Reference Manual                                  MicroEMACS Bindings
  4437.  
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.                                      Appendix D                                     Appendix D
  4444.  
  4445.                                 MicroEMACS Bindings                                MicroEMACS Bindings
  4446.  
  4447.  
  4448.           Below  is  a  complete list of the key bindings used in MicroEMACS. This
  4449.   can be used as a wall chart reference for MicroEMACS commands.
  4450.  
  4451.                        Default Key Bindings for MicroEmacs 3.11                       Default Key Bindings for MicroEmacs 3.11
  4452.  
  4453.    ^A   Move to start of line           ESC A   Apropos (list some commands)
  4454.    ^B   Move backward by characters     ESC B   Backup by words
  4455.    ^C   Insert space                    ESC C   Initial capitalize word
  4456.    ^D   Forward delete                  ESC D   Delete forward word
  4457.    ^E   Goto end of line                ESC E   Reset Encryption Key
  4458.    ^F   Move forward by characters      ESC F   Advance by words
  4459.    ^G   Abort out of things             ESC G   Go to a line
  4460.    ^H   Backward delete
  4461.    ^I   Insert tab/Set tab stops
  4462.    ^J   Insert <NL>, then indent
  4463.    ^K   Kill forward                    ESC K   Bind Key to function
  4464.    ^L   Refresh the screen              ESC L   Lower case word
  4465.    ^M   Insert <NL>                     ESC M   Add global mode
  4466.    ^N   Move forward by lines           ESC N   Goto End paragraph
  4467.    ^O   Open up a blank line
  4468.    ^P   Move backward by lines          ESC P   Goto Begining of paragraph
  4469.    ^Q   Insert literal                  ESC Q   Fill current paragraph
  4470.    ^R   Search backwards                ESC R   Search and replace
  4471.    ^S   Search forward                  ESC S   Suspend (BSD only)
  4472.    ^T   Transpose characters
  4473.    ^U   Repeat command four times       ESC U   Upper case word
  4474.    ^V   Move forward by pages           ESC V   Move backward by pages
  4475.    ^W   Kill region                     ESC W   Copy region to kill buffer
  4476.    ^Y   Yank back from killbuffer       ESC X   Execute named command
  4477.    ^Z   Move backward by pages          ESC Z   Save all buffers and exit
  4478.  
  4479.    ESC ^C   Count words in region       ESC ~   Unmark current buffer
  4480.    ESC ^E   Execute named procedure
  4481.    ESC ^F   Goto matching fence         ESC !   Reposition window
  4482.    ESC ^H   Delete backward word        ESC <   Move to start of buffer
  4483.    ESC ^K   Unbind Key from function    ESC >   Move to end of buffer
  4484.    ESC ^L   Reposition window           ESC .  Set mark
  4485.    ESC ^M   Delete global mode          ESC space    Set mark
  4486.    ESC ^N   Rename current buffer       ESC rubout   Delete backward word
  4487.    ESC ^R   Search & replace w/query        rubout   Backward delete
  4488.    ESC ^S   Source command file
  4489.    ESC ^V   Scroll next window down
  4490.  
  4491.  
  4492.                                                                                 78   MicroEMACS Bindings                                  MicroEMACS Reference Manual
  4493.  
  4494.  
  4495.    ESC ^W   Delete Paragraph
  4496.    ESC ^X   Execute command line
  4497.    ESC ^Z   Scroll next window up
  4498.  
  4499.    ^X <   Narrow-to-region           ^X ?   Describe a key
  4500.    ^X >   Widen-from-region          ^X !   Run 1 command in a shell
  4501.    ^X =   Show the cursor position   ^X @    Pipe shell command to buffer
  4502.    ^X ^   Enlarge display window     ^X #   Filter buffer thru shell filter
  4503.    ^X 0   Delete current window      ^X $   Execute an external program
  4504.    ^X 1   Delete other windows       ^X (   Begin macro
  4505.    ^X 2   Split current window       ^X )   End macro
  4506.                                      ^X A   Set variable value
  4507.    ^X ^B   Display buffer list       ^X B   Switch a window to a buffer
  4508.    ^X ^C   Exit MicroEMACS           ^X C   Start a new command processor
  4509.    ^X ^D   Detab line                ^X D   Suspend MicroEMACS (BSD4.2 only)
  4510.    ^X ^E   Entab line                ^X E   Execute macro
  4511.    ^X ^F   Find file                 ^X F   Set fill column
  4512.    ^X ^I   Insert file
  4513.                                      ^X K   Delete buffer
  4514.    ^X ^L   Lower case region
  4515.    ^X ^M   Delete Mode               ^X M   Add a mode
  4516.    ^X ^N   Move window down          ^X N   Rename current filename
  4517.    ^X ^O   Delete blank lines        ^X O   Move to the next window
  4518.    ^X ^P   Move window up            ^X P   Move to the previous window
  4519.    ^X ^R   Get a file from disk      ^X R   Incremental reverse search
  4520.    ^X ^S   Save current file         ^X S   Incremental forward search
  4521.    ^X ^T   Trim line                 (Incremental search
  4522.    ^X ^U   Upper case region                not always available)
  4523.    ^X ^V   View file
  4524.    ^X ^W   Write a file to disk      ^X W   resize Window
  4525.    ^X ^X   Swap "." and mark         ^X X   Use next buffer
  4526.    ^X ^Z   Shrink window             ^X Z   Enlarge display window
  4527.  
  4528.   Usable Modes  ______ _____
  4529.   WRAP     Lines going past right margin "wrap" to a new line
  4530.   VIEW     Read-Only mode where no modifications are allowed
  4531.   CMODE    Change behavior of some commands to work better with C
  4532.   EXACT    Exact case matching on search strings
  4533.   OVER     Overwrite typed characters instead of inserting them
  4534.   CRYPT    Current buffer will be encrypted on write, decrypted on read
  4535.   MAGIC    Use regular expression matching in searches
  4536.   ASAVE    Save the file every 256 inserted characters
  4537.  
  4538.   WHITE/CYAN/MAGENTA/YELLOW/BLUE/RED/GREEN/BLACK  Sets foreground color
  4539.   white/cyan/magenta/yellow/blue/red/green/black  Sets background color
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.   79   MicroEMACS Reference Manual                                    Numeric Arguments
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.                                      Appendix E                                     Appendix E
  4556.  
  4557.                                  Numeric Arguments                                 Numeric Arguments
  4558.  
  4559.  
  4560.  
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.  
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.                                                                                 80   Numeric Arguments to Commands                        MicroEMACS Reference Manual
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.                                      Appendix F                                     Appendix F
  4612.  
  4613.                            Numeric Arguments to Commands                           Numeric Arguments to Commands
  4614.  
  4615.  
  4616.           In general, preceding a  MicroEMACS  command  with  a numeric argument n                                                                                 n
  4617.   causes the command to be  executed  n  times.    However, there are a great many                                      n
  4618.   commands for which this has no effect, simply because it would make no sense for
  4619.   the command to be executed more than once.  There are  also  commands  that take
  4620.   advantage of the numeric  arguments  to alter their behavior subtly or unsubtly.
  4621.   The following is a list of these commands.  Commands that  are  not  affected at
  4622.   all by numeric arguments are listed afterwards.
  4623.  
  4624.   backward-character
  4625.                      A negative argument invokes forward-character.                                                 _________________
  4626.  
  4627.   change-screen-size
  4628.                      With  no  arguments,  the  number  of  rows  defaults to  the
  4629.                      largest.  Otherwise, set the screen size to n.                                                                 n
  4630.  
  4631.   change-screen-width
  4632.                      With  no arguments, the number of  columns  defaults  to  the
  4633.                      largest.  Otherwise, set the screen width to n.                                                                  n
  4634.  
  4635.   clear-and-redraw   With an  argument,  centers  the  window  around  the current
  4636.                      cursor position.
  4637.  
  4638.   delete-next-character
  4639.                      A negative argument invokes delete-previous-character.                                                 _________________________
  4640.  
  4641.   delete-next-word   With  an  argument  of  0,  will  not  delete the  whitespace
  4642.                      trailing the deleted word.  A  negative  argument  will cause
  4643.                      nothing to happen.
  4644.  
  4645.   delete-previous-character
  4646.                      A negative argument invokes delete-next-character.                                                 _____________________
  4647.  
  4648.   delete-previous-word
  4649.                      An negative or zero argument will cause nothing to happen.
  4650.  
  4651.   detab-region       Without an argument, detab-region changes hard tabs to spaces                                          ____________
  4652.                      in  the  lines between the mark and  the  cursor.    With  an
  4653.                      argument  n, the commands detab n lines -  forward  if  n  is                               n                     n                       n
  4654.                      positive, backwards if not.
  4655.  
  4656.   end-of-word        A negative argument invokes next-word.                                                 _________
  4657.  
  4658.  
  4659.  
  4660.   81   MicroEMACS Reference Manual                        Numeric Arguments to Commands
  4661.  
  4662.  
  4663.   entab-region       Without an argument, entab-region changes spaces to hard tabs                                          ____________
  4664.                      in  the  lines between the mark and  the  cursor.    With  an
  4665.                      argument  n, the commands entab n lines -  forward  if  n  is                               n                     n                       n
  4666.                      positive, backwards if not.
  4667.  
  4668.   exchange-point-and-mark
  4669.                      Swap the current cursor position  and mark number n.  Without                                                                       n
  4670.                      an argument, n defaults to 0.                                  n
  4671.  
  4672.   exit-emacs         Providing a numeric  argument  n causes two things to happen.                                                    n
  4673.                      First, no  checking for modified buffers will occur.  Second,
  4674.                      MicroEMACS exits with a status of n.                                                       n
  4675.  
  4676.   forward-character  A negative argument invokes backward-character.                                                 __________________
  4677.  
  4678.   goto-line          An argument n  will  be  taken  as  the line number to go to.                                 n
  4679.                      Without an argument, you will be asked for a line number.  In
  4680.                      either case, the line number must be 1 or greater.
  4681.  
  4682.   goto-mark          Go to mark number n.  Without an argument, n defaults to 0.                                       n                        n
  4683.  
  4684.   grow-window        A negative  argument invokes shrink-window.  An argument of 0                                                  _____________
  4685.                      causes no action.
  4686.  
  4687.   handle-tab         Without an argument, handle-tab deals with the tab character,                                          __________
  4688.                      whether  it should be a single "hard"  tab,  or  expanded  as
  4689.                      spaces.  With an argument n, $softtab is set to n.                                               n                     n
  4690.  
  4691.   hunt-backward      The  command  will  hunt  n  times.  The command will  report                                               n
  4692.                      failure if it cannot  find  its pattern the nth time, even if                                                                 nth
  4693.                      has found an occurrence of the pattern before number  n.    A                                                                           n
  4694.                      negative argument invokes hunt-forward.                                               ____________
  4695.  
  4696.   hunt-forward       The  command  will  hunt  n  times.  The command will  report                                               n
  4697.                      failure if it cannot  find  its pattern the nth time, even if                                                                 nth
  4698.                      has found an occurrence of the pattern before number  n.    A                                                                           n
  4699.                      negative argument invokes hunt-backward.                                               _____________
  4700.  
  4701.   kill-to-end-of-line
  4702.                      With no argument n, the command deletes all characters to the                                      n
  4703.                      end of the line.  If it is already at the end of the line, it
  4704.                      will delete the newline.    With a positive n as an argument,                                                                 n
  4705.                      the command will delete n complete  lines,  newline character                                             n
  4706.                      and all, starting from the cursor.  With n equal to zero, the                                                              n
  4707.                      command deletes all text from  the cursor to the beginning of
  4708.                      the line, but will not delete past the newline character.   A
  4709.                      negative n is illegal.                              n
  4710.  
  4711.   list-buffers       With a numeric argument, INVISIBLE buffers are also listed.
  4712.  
  4713.   move-window-down   With a negative argument, invokes move-window-up.                                                       ______________
  4714.  
  4715.  
  4716.                                                                                 82   Numeric Arguments to Commands                        MicroEMACS Reference Manual
  4717.  
  4718.  
  4719.   move-window-up     With a negative argument, invokes move-window-down.                                                       ________________
  4720.  
  4721.   next-buffer        With an argument n,  the  nth buffer after the current one is                                      n        nth
  4722.                      selected, and read in if necessary.  Any  buffers  in between
  4723.                      the  current  buffer  and the target buffer that have not yet
  4724.                      been read in are read.
  4725.  
  4726.   next-line          A negative argument invokes previous-line.                                                 _____________
  4727.  
  4728.   next-page          Without an argument, the window is scrolled forward by a full
  4729.                      page. With an argument n,  the window is scrolled forwards by                                            n
  4730.                      n lines.  Negative arguments invoke previous-page.                     n                                   _____________
  4731.  
  4732.   next-paragraph     A negative argument invokes previous-paragraph.                                                 __________________
  4733.  
  4734.   next-window        With  a  positive  argument  n,  the nth window from the  top                                                  n       nth
  4735.                      becomes the working window.    With  a negative argument, the
  4736.                      nth window from the bottom becomes the working window.                     nth
  4737.  
  4738.   next-word          A negative argument invokes next-word.                                                 _________
  4739.  
  4740.   previous-line      A negative argument invokes next-line.                                                 _________
  4741.  
  4742.   previous-page      Without an argument, the window  is  scrolled  backward  by a
  4743.                      full  page.  With  an  argument  n,  the  window is  scrolled                                                      n
  4744.                      backwards by n lines.  Negative arguments invoke next-page.                                  n                                   _________
  4745.  
  4746.   previous-paragraph
  4747.                      A negative argument invokes next-paragraph.                                                 ______________
  4748.  
  4749.   previous-window    With  a  positive  argument n, the nth window from the bottom                                                 n      nth
  4750.                      becomes the working window.    With  a negative argument, the
  4751.                      nth window from the top becomes the working window.                     nth
  4752.  
  4753.   previous-word      A negative argument invokes next-word.                                                 _________
  4754.  
  4755.   query-replace-string
  4756.                      With a numeric  argument,  n occurrences of the search string                                                n
  4757.                      may be replaced, depending upon  the  user's  response.   The
  4758.                      count  is  based  on the number of occurrences found, not the
  4759.                      number of positive responses from the user.
  4760.  
  4761.   quick-exit         Saves all modifed buffers, and exits with a status of n.                                                                           n
  4762.  
  4763.   redraw-display     With no argument, or when n  is  0, the window is adjusted so                                               n
  4764.                      that  the  cursor  is in the center.  When n is positive, the                                                                n
  4765.                      window is adjusted so that the  cursor  is on the nth line of                                                                       nth
  4766.                      the screen.  When n is negative, the window  is  adjusted  so                                       n
  4767.                      that the cursor is on the last line of the window, regardless
  4768.                      of the magnitude of n.                                         n
  4769.  
  4770.  
  4771.  
  4772.   83   MicroEMACS Reference Manual                        Numeric Arguments to Commands
  4773.  
  4774.  
  4775.   remove-mark        Remove mark number n.  Without an argument, n defaults to 0.                                        n                        n
  4776.  
  4777.   replace-string     Will  replace n occurrences of the  search  string  with  the                                   n
  4778.                      replacement  string.     Otherwise,  with  no  argument,  all
  4779.                      occurrences from the cursor position to the end  of  file are
  4780.                      replaced.
  4781.  
  4782.   resize-window      Requires an argument which must be positive.
  4783.  
  4784.   scroll-next-down   Behavior is same as with next-page.                                              _________
  4785.  
  4786.   scroll-next-up     Behavior is same as with previous-page.                                              _____________
  4787.  
  4788.   search-forward     The command will search  n  times.    The command will report                                              n
  4789.                      failure if it cannot  find  its pattern the nth time, even if                                                                 nth
  4790.                      has found an occurrence of the pattern before number  n.    A                                                                           n
  4791.                      negative argument invokes search-reverse.                                               ______________
  4792.  
  4793.   search-reverse     The command will search  n  times.    The command will report                                              n
  4794.                      failure if it cannot  find  its pattern the nth time, even if                                                                 nth
  4795.                      has found an occurrence of the pattern before number  n.    A                                                                           n
  4796.                      negative argument invokes search-forward.                                               ______________
  4797.  
  4798.   select-buffer      Without an argument, the  buffer  is  simply displayed in the
  4799.                      window.  With an argument,  the buffer is not only displayed,
  4800.                      but also given the attribute INVISIBLE.
  4801.  
  4802.   set                If using the set command interactively, preceding the command                                  ___
  4803.                      with  a numeric argument then makes  it  unecessary  for  the
  4804.                      command  to  ask  for the variable's value (it will still ask
  4805.                      for the variable's name).  If used in a  command  line,  then
  4806.                      the command
  4807.  
  4808.                              set <variable name> <number>
  4809.  
  4810.   is identical to
  4811.  
  4812.                              <number> set <variable name>
  4813.  
  4814.   set-fill-column    With an argument, the fill column  is  set to n.  The default                                                                   n
  4815.                      argument is 1.
  4816.  
  4817.   set-mark           Set mark number n.  Without an argument, n defaults to 0.                                     n                        n
  4818.  
  4819.   shrink-window      A negative  argument invokes shrink-window.  An argument of 0                                                  _____________
  4820.                      causes no action.
  4821.  
  4822.   split-current-window
  4823.                      With n = 1, the new upper window becomes the  current window.                          n
  4824.                      Any other numeric argument makes  the  new  lower  window the
  4825.                      current window.  With no argument, the current window becomes
  4826.  
  4827.  
  4828.                                                                                 84   Numeric Arguments to Commands                        MicroEMACS Reference Manual
  4829.  
  4830.  
  4831.                      the  new upper or lower window  depending  upon  whether  the
  4832.                      cursor was in the upper or lower half of the old window.
  4833.  
  4834.   store-macro        Since  macroes  are  numbered,  a  numeric  argument  must be
  4835.                      provided. These numbered  macroes  are  being  phased  out in
  4836.                      preference for named macros.
  4837.  
  4838.   store-procedure    If the command is provided a numeric argument, it will assume
  4839.                      that store-macro is actually being called.                          ___________
  4840.  
  4841.   trim-region        Without an argument, trim-region removes spaces and tabs from                                          ___________
  4842.                      the end of the lines between the mark and the cursor. With an
  4843.                      argument n,  the  commands  trim  n  lines  - forward if n is                              n                        n                      n
  4844.                      positive, backwards if not.
  4845.  
  4846.   F.1  Commands unaffected by numeric arguments.  F.1  Commands unaffected by numeric arguments.
  4847.  
  4848.   abort-command              describe-functions         narrow-to-region
  4849.   add-global-mode            describe-key               nop
  4850.   add-mode                   describe-variables         pipe-command
  4851.   append-file                display                    pop-buffer
  4852.   apropos                    end-macro                  print
  4853.   back-from-tag-word         end-of-file                re-tag-word
  4854.   begin-macro                end-of-line                read-file
  4855.   beginning-of-file          execute-command-line       restore-window
  4856.   beginning-of-line          execute-program            reverse-incremental-
  4857.   bind-to-key                fill-paragraph             search
  4858.   buffer-position            filter-buffer              save-file
  4859.   case-region-lower          find-file                  save-window
  4860.   case-region-upper          find-screen                set-encryption-key
  4861.   change-file-name           goto-matching-fence        shell-command
  4862.   clear-message-line         help                       suspend-emacs
  4863.   copy-region                i-shell                    tag-word
  4864.   count-words                incremental-search         transpose-characters
  4865.   cycle-screens              insert-file                unbind-key
  4866.   delete-blank-lines         kill-region                unmark-buffer
  4867.   delete-buffer              macro-to-key               update-screen
  4868.   delete-global-mode         mouse-move-down            view-file
  4869.   delete-mode                mouse-move-up              widen-from-region
  4870.   delete-other-windows       mouse-region-down          wrap-word
  4871.   delete-screen              mouse-region-up            write-file
  4872.   delete-window              mouse-resize-screen        write-message
  4873.   describe-bindings          name-buffer
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.   85   MicroEMACS Reference Manual                                   Supported machines
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.                                      Appendix G                                     Appendix G
  4892.  
  4893.                                  Supported machines                                 Supported machines
  4894.  
  4895.  
  4896.           The  following  table  lists  all  the  hardware/compilers  for which  I
  4897.   currently support MicroEMACS.  This  is  not  exclusive  of  all  machines which
  4898.   MicroEMACS  will  run on, but I have either run it myself, or had a  first  hand
  4899.   report of it running.
  4900.  
  4901.   Hardware        OS              Compiler        Comments  ________        __              ________        ________
  4902.   VAX 780         UNIX V5         native
  4903.                   UNIX V7         native
  4904.                   BSD 4.2         native          job control supported
  4905.                   VMS             native          SMG & ANSI support
  4906.  
  4907.   SUN             SUNOS 3 & 4     native
  4908.                                   gcc
  4909.  
  4910.   NCR Tower       UNIX V5         native
  4911.  
  4912.   IBM-RT PC       BSD 4.3         native
  4913.                   AIX             native
  4914.  
  4915.   HP9000          UNIX V5         native
  4916.  
  4917.   Fortune 32:16   UNIX V7         native
  4918.  
  4919.   IBM-PC          MSDOS           LATTICE 3       Large CODE/Large DATA
  4920.                    2.0 & 3.2      AZTEC 3.4e      Large CODE/Large DATA
  4921.                                   TURBO C 2.0     LARGE memory model
  4922.                                   MSC 6.0
  4923.                                   *MWC 86
  4924.                   SCO XENIX       native
  4925.  
  4926.   HP150           MSDOS           Lattice 2.15    Function key labels
  4927.                                   Turbo C 2.0             for the touch screen
  4928.  
  4929.   HP110           MSDOS           Lattice 2.15
  4930.                                   Aztec 3.4e
  4931.                                   Turbo C 2.0
  4932.  
  4933.   *Data General 10
  4934.                   MSDOS           Lattice 2.1  Texas Instruments Professional
  4935.                   MSDOS           Lattice 2.15
  4936.  
  4937.   Amiga           Intuition       Lattice 3.03
  4938.  
  4939.  
  4940.                                                                                 86   Supported machines                                   MicroEMACS Reference Manual
  4941.  
  4942.  
  4943.                                   Aztec 3.6
  4944.  
  4945.   ST520           TOS             Mark Williams C Spawns under MSH
  4946.                                   Lattice 3.1     (no shell commands)
  4947.  
  4948.   Fujitsu FMR     MSDOS           MSC 6.0
  4949.      series
  4950.  
  4951.   NEC 9800        MSDOS           Turbo 2.0       Function key support
  4952.      series                       MSC 6.0
  4953.  
  4954.   HP3000 series   MPE             native
  4955.  
  4956.   Systems to be supported (IE some code is already written:)  _______ __ __ _________ ___ ____ ____ __ _______ _________
  4957.   Macintosh       System 7        Lightspeed C
  4958.  
  4959.   *means that I do not own or have access to the listed compiler and/or
  4960.    machine and must rely upon others to help support it.
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.   87   MicroEMACS Reference Manual                                        Function Keys
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.                                      Appendix H                                     Appendix H
  5004.  
  5005.                                    Function Keys                                   Function Keys
  5006.  
  5007.  
  5008.           All environments now support a set of machine  independant  bindings for
  5009.   function keys. Below is a list of these bindings (not all of these are supported
  5010.   on all systems).
  5011.  
  5012.                           Function keys in MicroEmacs
  5013.  
  5014.           function        Function        ^function       Alt-function
  5015.    f1)      FN1            S-FN1            FN^1            A-FN1
  5016.    f2)      FN2            S-FN2            FN^2            A-FN2
  5017.    f3)      FN3            S-FN3            FN^3            A-FN3
  5018.    f4)      FN4            S-FN4            FN^4            A-FN4
  5019.    f5)      FN5            S-FN5            FN^5            A-FN5
  5020.    f6)      FN6            S-FN6            FN^6            A-FN6
  5021.    f7)      FN7            S-FN7            FN^7            A-FN7
  5022.    f8)      FN8            S-FN8            FN^8            A-FN8
  5023.    f9)      FN9            S-FN9            FN^9            A-FN9
  5024.   f10)      FN0            S-FN0            FN^0            A-FN0
  5025.  
  5026.   home)     FN<                             FN^<
  5027.   CsUp)     FNP                             FN^P
  5028.   PgUp)     FNZ                             FN^Z
  5029.   CsLf)     FNB                             FN^B
  5030.    5  )
  5031.   CsRt)     FNF                             FN^F
  5032.    End)     FN>                             FN^>
  5033.   CsDn)     FNN                             FN^N
  5034.   PgDn)     FNV                             FN^V
  5035.    Ins)     FNC                             FN^C
  5036.    Del)     FND                             FN^D
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.  
  5043.  
  5044.  
  5045.  
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.  
  5052.                                                                                 88   Machine Dependent Notes                              MicroEMACS Reference Manual
  5053.  
  5054.  
  5055.  
  5056.  
  5057.  
  5058.  
  5059.                                      Appendix I                                     Appendix I
  5060.  
  5061.                               Machine Dependent Notes                              Machine Dependent Notes
  5062.  
  5063.  
  5064.           This appendix lists some notes specific to individual implementations of
  5065.   MicroEMACS. Every attempt has been made  to  allow  EMACS to be identical on all
  5066.   machines, but we  have  also  tried  to  take advantage of function keys, cursor
  5067.   keys, mice, and special screen modes where possible.
  5068.  
  5069.   I.1  IBM-PC/XT/AT and its clones  I.1  IBM-PC/XT/AT and its clones
  5070.  
  5071.  
  5072.           The IBM-PC family of computers is supported with a variety  of different
  5073.   display adapters. EMACS will  attempt  to discover what adapter is connected and
  5074.   use  the proper driver for it. Below is a list of the currently supported  video
  5075.   adapters:
  5076.  
  5077.   Adapter                         $sres           Original mode used  _______                         _____           ________ ____ ____
  5078.   Monochrome Graphics Adapter     MONO            MONO
  5079.   Color Graphics Adapter          CGA             CGA
  5080.                                   CGA40           CGA40
  5081.   Enhanced Graphics Adapter       EGA             CGA
  5082.   Video Graphics Adapter          VGA             CGA
  5083.                                   VGA12
  5084.  
  5085.           If a driver for a Microsoft compatable mouse is installed on the system,
  5086.   EMACS will use the mouse  in text mode and allow the user all the standard mouse
  5087.   functions. The mouse cursor will  appear  to  be  a  block of color in the color
  5088.   opposite of it's background.
  5089.  
  5090.           EMACS also takes advantage of various function keys and the keys  on the
  5091.   keypad on an IBM-PC. The function keys are initially not bound to any particular
  5092.   functions (except by the emacs.rc startup file), but the keypad keys  do default
  5093.   to the following:
  5094.  
  5095.   Keypad key      Function  ______ ___      ________
  5096.   Home            beginning-of-file
  5097.   CSRS UP         previous-line
  5098.   Pg Up           previous-page
  5099.   CSRS LEFT       backward-character
  5100.   CSRS RIGHT      forward-character
  5101.   End             end-of-file
  5102.   CSRS DOWN       next-line
  5103.   Pg Dn           Next-page
  5104.  
  5105.  
  5106.  
  5107.  
  5108.   89   MicroEMACS Reference Manual                              Machine Dependent Notes
  5109.  
  5110.  
  5111.           All these special keys are indicated in EMACS macroes by  use  of the FN                                                                                FN
  5112.   prefix. Below is a list of many of the keys and the codes used to  specify them.
  5113.   Also the codes may be gotten by using  the  describe-key  (^X  ?) command on the
  5114.   suspect key.
  5115.  
  5116.   Compiling under TURBO C  Compiling under TURBO C
  5117.  
  5118.           To  compile  MicroEMACS   under   TURBO  C,  set  the  TURBO  integrated
  5119.   environment with the following options:
  5120.  
  5121.           Memory model            LARGE
  5122.           Floating point          NONE
  5123.           Default char type       UNSIGNED
  5124.           Data alignment          BYTE
  5125.           Merge duplicate strings ON
  5126.           Standard stack frame    off
  5127.           Test stack overflow     off
  5128.  
  5129.           Optimize for                    SIZE
  5130.           Use register optimization       ON
  5131.           Register optimization           ON
  5132.           Jump optimization               ON
  5133.  
  5134.           Initialize segments     OFF
  5135.           Stack warnings          OFF
  5136.  
  5137.           Names: Code names
  5138.                   Segment name    *
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.  
  5157.  
  5158.  
  5159.  
  5160.  
  5161.  
  5162.  
  5163.  
  5164.                                                                                 90   Machine Dependent Notes                              MicroEMACS Reference Manual
  5165.  
  5166.  
  5167.  
  5168.   I.2  HP 150  I.2  HP 150
  5169.  
  5170.  
  5171.           This machine from Hewlett Packard is very unusual for an  MSDOS machine.
  5172.   It  has a touch screen and is very function key oriented. An additional command,
  5173.   label-function-key  allows you to place labels on the  on  screen  function  key  __________________
  5174.   labels. A numeric argument indicates which function key to  label  (one  through
  5175.   eight) and then the program prompts for a 16 character label, which will be used
  5176.   as two lines of eight characters. To label function key  three  with "save file"
  5177.   from a macro, you would use:
  5178.  
  5179.   3 label-function-key "save              file"
  5180.  
  5181.           Notice the 4 spaces after "save". This forces  "file"  to  begin  on the
  5182.   second line of the label.
  5183.  
  5184.  
  5185.  
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.   91   MicroEMACS Reference Manual                              Machine Dependent Notes
  5221.  
  5222.  
  5223.  
  5224.   I.3  Atari 520/1040ST  I.3  Atari 520/1040ST
  5225.  
  5226.  
  5227.           The ATARI ST family of computers  have  a dual personality. They may use
  5228.   either a monochrome or a color screen. EMACS supports two screen  resolutions on
  5229.   each monitor.
  5230.  
  5231.                                         NOTE                                        NOTE
  5232.  
  5233.        When you set MicroEMACS up on your system, please remember  to install
  5234.        it on the desktop as a GEM application. If you have EMACS set as a TOS
  5235.        application,  the mouse will not function  properly,  and  EMACS  will
  5236.        alert you to this problem by beeping the bell.
  5237.  
  5238.   Monitor $sres size #color $palette format  _______ _____ ____ ______ ________ ______
  5239.   Color   LOW     40x25   16      000111222333444555666777
  5240.           MEDIUM  80x25   4       000111222333
  5241.   Mono    HIGH    80x25   2       000
  5242.           DENSE   80x50   2       000
  5243.  
  5244.           The $palette environment variable can be used to change  what  color  is
  5245.   associated  with  each  color name. With a color monitor, each  group  of  three
  5246.   digits  indicates  an  octal number specifying the RED, GREEN and BLUE levels of
  5247.   that color. Each color digit  can  vary  from  0  to 7. For example, the initial
  5248.   setting of $palette in LOW resolution is:
  5249.  
  5250.           000700070770007707077777
  5251.  
  5252.           which broken up is:
  5253.  
  5254.           000 700 070 770 007 707 077 777
  5255.  
  5256.           which means:
  5257.  
  5258.           000     Black
  5259.           700     Red
  5260.           070     Green
  5261.           770     Yellow
  5262.           007     Blue
  5263.           707     Magenta
  5264.           077     Cyan
  5265.           777     White
  5266.  
  5267.           Also the mouse buttons are bound to mouse functions as described  in the
  5268.   chapter about mice. The cursor keys and the function keys are bound similarly to
  5269.   IBM-PC.
  5270.  
  5271.           Files generated by EMACS on the ATARI ST have a single  return character
  5272.   at  the  end  of each line, unlike the desktop files  which  want  to  have  two
  5273.   returns. This makes  it  display  files  strangely from GEM's [SHOW] option, but
  5274.  
  5275.  
  5276.                                                                                 92   Machine Dependent Notes                              MicroEMACS Reference Manual
  5277.  
  5278.  
  5279.   makes the files port  to  other computers much nicer. When compiling MicroEMACS,
  5280.   the ADDCR symbol in estruct.h will cause emacs to generate line ending sequences                      estruct.h
  5281.   compatible with GEM.
  5282.  
  5283.           Currently, when operating under the Mark Williams MSH program, EMACS can
  5284.   shell out and perform external commands. This capability will be added later for
  5285.   the Beckmeyer shell and under GEMDOS.
  5286.  
  5287.  
  5288.  
  5289.  
  5290.  
  5291.  
  5292.  
  5293.  
  5294.  
  5295.  
  5296.  
  5297.  
  5298.  
  5299.  
  5300.  
  5301.  
  5302.  
  5303.  
  5304.  
  5305.  
  5306.  
  5307.  
  5308.  
  5309.  
  5310.  
  5311.  
  5312.  
  5313.  
  5314.  
  5315.  
  5316.  
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.  
  5331.  
  5332.   93   MicroEMACS Reference Manual                              Machine Dependent Notes
  5333.  
  5334.  
  5335.  
  5336.   I.4  Amiga 1000  I.4  Amiga 1000
  5337.  
  5338.  
  5339.           The  Commodore  AMIGA  1000 version of MicroEMACS does fully support the
  5340.   mouse, window resizing and the close gadget. It runs in medium resolution, using
  5341.   the colors defined for the workbench.
  5342.  
  5343.                           Note about Compiling MicroEMACS
  5344.  
  5345.                If you are compiling the sources on the AMIGA  to  produce  an
  5346.        executable image, and you  are  using the Lattice compiler, be sure to
  5347.        give the CLI command  'STACK  40000' before compiling to make sure the
  5348.        compiler  has  sufficient  stack   space   to   successfully  complete
  5349.        compilation.
  5350.  
  5351.  
  5352.  
  5353.  
  5354.  
  5355.  
  5356.  
  5357.  
  5358.  
  5359.  
  5360.  
  5361.  
  5362.  
  5363.  
  5364.  
  5365.  
  5366.  
  5367.  
  5368.  
  5369.  
  5370.  
  5371.  
  5372.  
  5373.  
  5374.  
  5375.  
  5376.  
  5377.  
  5378.  
  5379.  
  5380.  
  5381.  
  5382.  
  5383.  
  5384.  
  5385.  
  5386.  
  5387.  
  5388.                                                                                 94   Machine Dependent Notes                              MicroEMACS Reference Manual
  5389.  
  5390.  
  5391.  
  5392.   I.5  UNIX V5, V7, and BSD4.[23]  I.5  UNIX V5, V7, and BSD4.[23]
  5393.  
  5394.  
  5395.           MicroEMACS under UNIX utilizes  the  TERMCAP  library to provide machine                                               TERMCAP
  5396.   independent screen functions. Make sure that termcap is  available  and properly
  5397.   set on your account before attempting to use MicroEMACS.
  5398.  
  5399.           Under systems which support job control, you can use  the  ^XD  suspend-                                                                     ^XD  ________
  5400.   emacs  command  to  place EMACS into the background. This carries a much smaller  _____
  5401.   overhead  than  bringing  up a new shell under EMACS. EMACS will properly redraw
  5402.   the screen when you bring it back to the foreground.
  5403.  
  5404.           If the  symbol  VT100  has  been set to 1 in the estruct.h options file,                                                           _________
  5405.   EMACS will recognize  the key sequence <ESC>[ as the lead in sequence for the FN
  5406.   function key prefix.
  5407.  
  5408.           With the addition  of  some very machine/operating system specific code,
  5409.   EMACS can prevent two or more people from modifying the same  file  at  the same
  5410.   time. The upper level of a set of functions to provide file locking exist in the
  5411.   source  file LOCK.C.  It requires two machine  specific  functions  written  and               LOCK.C
  5412.   linked into EMACS for it to operate properly.
  5413.  
  5414.           char *dolock(fname)
  5415.  
  5416.           char *fname;
  5417.  
  5418.           dolock() locks a file, preventing others from modifying it. If
  5419.           it succeeds, it returns NULL, otherwise it returns a pointer to
  5420.           a string in the form "LOCK ERROR: explanation".
  5421.  
  5422.           char *undolock(fname)
  5423.  
  5424.           char *fname;
  5425.  
  5426.           undolock() unlocks a file, allowing others to modifying it. If
  5427.           it succeeds, it returns NULL, otherwise it returns a pointer to
  5428.           a string in the form "LOCK ERROR: explanation".
  5429.  
  5430.  
  5431.  
  5432.  
  5433.  
  5434.  
  5435.  
  5436.  
  5437.  
  5438.  
  5439.  
  5440.  
  5441.  
  5442.  
  5443.  
  5444.   95   MicroEMACS Reference Manual                              Machine Dependent Notes
  5445.  
  5446.  
  5447.  
  5448.   I.6  DEC VMS operating system  I.6  DEC VMS operating system
  5449.  
  5450.  
  5451.   TERMINALS  TERMINALS
  5452.  
  5453.           Depending upon the options set  in ESTRUCT.H, MicroEMACS uses either the
  5454.   capabilities  of  VMS  SMG,  working  with  any  terminal  that  is  defined  in
  5455.   SMGTERMS.TXT or TERMTABLE.TXT (see your SMG manual for more information), or the
  5456.   ANSI escape sequences. Full keyboard support, with function keys and everything,
  5457.   is provided for VT100 and VT200 series compatible terminals.  Mouse  support  is
  5458.   provided under the ANSI version only at this time. Mouse support is provided for
  5459.   the VSII workstation's VT220 terminal  emulator,  and  other  terminal emulators
  5460.   that use the same escape sequences for mouse  control.  (There  is  some partial
  5461.   support for the BBN BitGraph mouse sequences in the sources, but this is not yet
  5462.   complete). Terminals may have up to 100 lines and 160 columns.
  5463.  
  5464.           The  maximum  terminal  size is 256 columns  and  72  row.  If  you  run
  5465.   MicroEMACS  on a terminal that is larger than this, MicroEMACS will reduce it to
  5466.   these limits while you are editing.
  5467.  
  5468.   Flow control  Flow control
  5469.           Some terminals will require  the  use of XON/XOFF flow control when used
  5470.   with MicroEMACS. When XON/XOFF flow control is used, you will not be able to use
  5471.   functions bound to ^S or ^Q, and should use bind-to-key  to  put these functions
  5472.   on other keys. MicroEMACS does not change the flow  control  characteristics  of
  5473.   your terminal line while it is running. If your terminal requires  flow control,
  5474.   you should:
  5475.  
  5476.           $ SET TERM/HOSTSYNC/TTSYNC
  5477.  
  5478.           before  entering  MicroEMACS.  If you are on a VSII emulated workstation
  5479.   terminal, are using  the  SSU  multi-session  protocol (VT330 and VT340 with SSU
  5480.   enabled), or  are  certain  that  your  terminal  does not require XON/XOFF flow
  5481.   control, you should
  5482.  
  5483.           $ SET TERM /HOSTSYNC/NOTTSYNC
  5484.  
  5485.           This  will allow you to use ^S and ^Q for MicroEMACS commands. Note that
  5486.   if  you  are using a VSII with VWS V3.2 or later, you must leave  the  /HOSTSYNC
  5487.   enabled  in  order  for the cross/session  cut  and  paste  capability  to  work
  5488.   properly.
  5489.  
  5490.  
  5491.   KEYBOARD  KEYBOARD
  5492.  
  5493.           The VMS version understands the LK201 functions of  VT200  series, vt300
  5494.   series, and compatible terminals and terminal emulators, and allows you  to bind
  5495.   to them as function keys. In addition, the VT100 numeric keypad,  in application
  5496.   mode,  is  available  as function keys. MicroEMACS will only put the keypad into
  5497.   application mode for you if the KEYPAD  option  is  set  in  ESTRUCT.H.  In this
  5498.  
  5499.  
  5500.                                                                                 96   Machine Dependent Notes                              MicroEMACS Reference Manual
  5501.  
  5502.  
  5503.   situation, MicroEmacs will  detect  your  kepad's  state, and restore it to that
  5504.   state  upon  exiting.  If MicroEMACS has not been compiled with this option, you
  5505.   may  still put the keypad into application mode by issuing the command "SET TERM
  5506.   /APPLICATION" before entering MicroEMACS.
  5507.  
  5508.   VT200 keys  _____ ____
  5509.  
  5510.   Note that F1 through F5 are local function keys on DEC terminals.
  5511.  
  5512.   F6         = FN6        FIND = FNS
  5513.   FN7        = FN7        INSERT = FNC
  5514.   F8         = FN8        REMOVE = FND
  5515.   F9         = FN9        SELECT = FN@
  5516.   F10        = FN0        PREV = FNZ
  5517.   F11        = S-FN1      NEXT = FNV
  5518.   F12        = S-FN2      Arrow Up = FNP
  5519.   F13        = S-FN3      Arrow Down = FNN
  5520.   F14        = S-FN4      Arrow Right = FNF
  5521.   HELP (F15) = S-FN5      Arrow Left = FNB
  5522.   DO (F16)   = S-FN6
  5523.   F17        = S-FN7
  5524.   F18        = S-FN8
  5525.   F19        = S-FN9
  5526.   F20        = S-FN0
  5527.  
  5528.   VT100 and VT200 numeric keypad in application mode  _____ ___ _____ _______ ______ __ ___________ ____
  5529.  
  5530.   PF1 = FN^1      PF2 = FN^2      PF3 = FN^3      PF4   = FN^4
  5531.   7   = A-7       8   = A-8       9   = A-9       -     = A--
  5532.   4   = A-4       5   = A-5       6   = A-6       ,     = A-,
  5533.   1   = A-1       2   = A-2       3   = A-3       ENTER = A-E
  5534.   0   = A-0       .  = A-.
  5535.  
  5536.                                       WARNING                                      WARNING
  5537.  
  5538.                The VMS version contains code for  interpreting  function keys
  5539.        that are sent  as  Ansi  sequences  that begin with the ESC character.
  5540.        Because  of  this,  MicroEMACS cannot process an incoming ESC until it
  5541.        knows  what  character  follows  it.  This  can  cause  problems  with
  5542.        terminating search and replace strings. If you use ESC  as  the  meta-
  5543.        prefix character (which is the default) you must  type  one additional
  5544.        keystroke  following ESC before emacs will  recognize  that  you  have
  5545.        edited the  search command prompt, and are continuing. (The additional
  5546.        character is processed normally be MicroEMACS, it is NOT discarded.)
  5547.  
  5548.                MicroEMACS must wait long  enough  for  the network delay that
  5549.        might be involved between  seeing  the  ESC  and seeing the characters
  5550.        that  follow  it.  If  holding  down  one  of  the  arrow keys  causes
  5551.        characters to drop  into  your  file,  then  you may want to alter the
  5552.        delay yourself. The logical variable MICROEMACS$SHORTWAIT  may  be set
  5553.  
  5554.  
  5555.  
  5556.   97   MicroEMACS Reference Manual                              Machine Dependent Notes
  5557.  
  5558.  
  5559.        to vary that delay. The default delay is 400ms (4 tenths of a second).
  5560.        The equivalent value in MICROEMACS$SHORTWAIT is 4000000.
  5561.  
  5562.   Special case for BBN BItGraph  Special case for BBN BItGraph
  5563.  
  5564.           If you are using the BBN BitGraph, execute the following commands before
  5565.   entering MicroEMACS, and you will get mouse support:
  5566.  
  5567.           $ esc[0,8] = 27
  5568.           $ microemacs$mouse_enable == esc+":5;6;L"+esc+":0;63;;;;;;;;;9;16;c"
  5569.           $ microemacs$mouse_disable == esc+":5;1;L"+esc+":0;0c"
  5570.           $ exit
  5571.  
  5572.           Do NOT do this for any other terminals.
  5573.  
  5574.   Search List for EMACS.RC  Search List for EMACS.RC
  5575.  
  5576.           VMS MicroEMACS will  first  search  logical  name  MICROEMACS$LIB:, then
  5577.   SYS$LOGIN:,  then the current directory, and finally  "sys$sysdevice:[vmstools]"
  5578.   when looking for startup files or help files.
  5579.  
  5580.           Please use MICROEMACS$LIB:, and allow the secondary search of [vmstools]
  5581.   to  become archaic. If desired, MICROEMACS$LIB may be defined to be a VMS search
  5582.   list that first searches a user directory, and then a system directory.
  5583.  
  5584.           Generally, you should create a private directory where you keep all your
  5585.   .CMD files, and in your LOGIN.COM $DEFINE a logical name to point to this area.
  5586.  
  5587.           In addition to  whatever  commands  you  have in your EMACS.RC file, one
  5588.   command  you should certainly include is "set $ssave  FALSE".  The  "safe  save"
  5589.   mechanism, which writes a buffer to a temporary file, deletes the old version of
  5590.   a file,  and  then  moves  the  temporary  file  to  its  permanent  name, works
  5591.   wonderfully  on  most  systems, but makes no sense on VMS, which maintains older
  5592.   versions of a file.
  5593.  
  5594.   Using MicroEMACS as a subprocess  Using MicroEMACS as a subprocess
  5595.           MicroEmacs can now be kept in a subprocess.  You  can  arrange  to start
  5596.   emacs only once in a job, and to re-attach to  it  each time you want to use it.
  5597.   This is optional. To use this feature, install MicroEMACS in the following way:
  5598.  
  5599.   1. MicroEMACS contains two images. ME.EXE is a small program for
  5600.       starting and stopping the Emacs subprocess. The source for ME.
  5601.       is in ME.C, and should not be linked into MESHR.EXE. MESHR.EXE
  5602.       is the actual MicroEMACS image. The name "MESHR" is required for
  5603.       MAIL/NOTES support, see next section for details.
  5604.  
  5605.   2. Make sure that the SYS$SHARE search list includes MESHR.EXE. If you
  5606.      don't have the privilages to move MESHR.EXE into SYS$SHARE, you
  5607.      can $ DEFINE the MESHR logical name to be the full name and location of
  5608.      the MESHR.EXE program. For example, you could store all of these
  5609.      programs in the MICROEMACS$LIB: search list, and say:
  5610.  
  5611.  
  5612.                                                                                 98   Machine Dependent Notes                              MicroEMACS Reference Manual
  5613.  
  5614.  
  5615.                   $ DEFINE MESHR microemacs$lib:meshr.exe
  5616.  
  5617.   3. Put ME.EXE in MICROEMACS$LIB and the following line in your LOGIN.COM:
  5618.  
  5619.                   $ me :== $microemacs$lib:me
  5620.  
  5621.   4. Put a line in your EMACS.RC that will
  5622.  
  5623.               bind-to-key suspend-emacs ^C  ; use your usual exit-emacs key
  5624.  
  5625.           Now,  use  the   "$   ME"  command  to  invoke  microemacs.  Subseqeuent
  5626.   invocations in the same job will re-use the existing subprocess. You can use the
  5627.   full capabilty of the microemacs command line in the first and in all subsequent
  5628.   invocations of ME.
  5629.  
  5630.           WARNING:
  5631.  
  5632.           MicroEMACS  will  ALWAYS  read in new copies of any files you specify on
  5633.   the command line, even if you are already editing it.  If  you  edit  a  file  a
  5634.   second time  with  the  same  MicroEMACS, you will get a NEW buffer with ANOTHER
  5635.   copy of the file. The old buffer is  still  there  also.  It  is  easy,  in this
  5636.   situation,  to  accidently  edit  in  a  WRONG BUFFER, and if you write  out  an
  5637.   obsolete buffer, you will loose earlier edits!
  5638.  
  5639.           This  is  considered  a bug and may be  fixed  in  a  later  version  of
  5640.   MicroEMACS. To avoid this situation, do not specify a file  on  the command line
  5641.   if MicroEMACS already has that file in a buffer. Use the  "find-file" MicroEMACS
  5642.   command instead.
  5643.  
  5644.  
  5645.           Using MICROEMACS with MAIL and NOTES:          Using MICROEMACS with MAIL and NOTES:
  5646.  
  5647.           With VMS V5 and later versions, the MAIL interface to Microemacs is much
  5648.   simplified. With VMS  V5, the MESHR.EXE image does NOT have to be installed as a
  5649.   known  image  to  be  used  as  a callable editor from MAIL. Therefore,  to  use
  5650.   MicroEMACS  as  your  VMS MAIL editor, simply add the following  lines  to  your
  5651.   LOGIN.COM:
  5652.  
  5653.                   $ DEFINE MAIL$EDIT CALLABLE_ME
  5654.                   $ MAIL :== MAIL/EDIT
  5655.  
  5656.           and make sure that the SYS$SHARE search list includes MESHR.EXE.  If you
  5657.   don't  have  privs  or permission to move MESHR.EXE into SYS$SHARE,  you  can  $
  5658.   DEFINE the MESHR  logical name to be the full name and location of the MESHR.EXE
  5659.   program.  For  example,  you  could  store  all  of  these   programs   in   the
  5660.   MICROEMACS$LIB: search list, and say:
  5661.  
  5662.                   $ DEFINE MESHR microemacs$lib:meshr.exe
  5663.  
  5664.           Note that this is the  same  location  as  is  required  for  using kept
  5665.   MicroEMACS.
  5666.  
  5667.  
  5668.   99   MicroEMACS Reference Manual                              Machine Dependent Notes
  5669.  
  5670.  
  5671.           To abort sending a message, exit MicroEMACS without writing out the mail
  5672.   message file.
  5673.  
  5674.           To use MicroEMACS as your VAX NOTES editor, issue the  following command
  5675.   to VAX NOTES:
  5676.  
  5677.                   NOTES> SET PROFILE/EDIT=(ME,CALL)
  5678.  
  5679.           Note,  if you are still in the dark ages of VMS V4,  you  will  have  to
  5680.   either  install  MESHR  as a known image, or following the original "Second way"
  5681.   instructions given in the  existing  appendix F.6 of the older MicroEMACS manual
  5682.   (previous to version 3.10).
  5683.  
  5684.   Second way, as described in older versions  Second way, as described in older versions
  5685.  
  5686.           In  the  event  that you cannot  get  your  system  manager  to  INSTALL
  5687.   MicroEMACS as known image, you can use the following technique:
  5688.  
  5689.   1. In MICROEMACS$LIB:MEMAIL.COM, put the following command file:
  5690.  
  5691.   $! Use on VAX/VMS as MAIL$EDIT for using MicroEMACS as mail editor.
  5692.   $ if "''P1'" .NES. "_NL:" then if "''P1'" .NES. "" then copy 'P1' 'P2'
  5693.   $ define/user sys$input sys$output
  5694.   $ me 'P2'
  5695.   $ exit
  5696.  
  5697.   This file may have come with your MicroEMACS kit.
  5698.  
  5699.   2. In your LOGIN.COM, put the following lines:
  5700.  
  5701.   $       me :== $MICROEMACS$LIB:MESHR.EXE ! Assumes meshr.exe is there
  5702.   $       define mail$edit microemacs$lib:me_edit.com
  5703.  
  5704.   3. In NOTES, give the command
  5705.  
  5706.   NOTES> SET PROFILE/EDIT=(@MicroEMACS$lib:me_edit.com,SPAWN)
  5707.  
  5708.   Building MicroEMACS for VMS  Building MicroEMACS for VMS
  5709.  
  5710.   The configuration options are set in file estruct.h:
  5711.  
  5712.   - Under the category of "Machine/OS definitions", set VMS to "1" and all
  5713.   others to "0".
  5714.  
  5715.   - Under "Compiler definitions", set all selections to "0". Selecting
  5716.   VMS implies that you are using VAXC.
  5717.  
  5718.   - Under "Special keyboard definitions", be sure "VT100" is set to "0".
  5719.   This option is not required for the VMS version, it is for other
  5720.   systems using ANSI terminal support. VMS in combination with SMG or
  5721.   ANSI already handles the special characteristics of Ansi keyboards.
  5722.  
  5723.  
  5724.                                                                                100   Machine Dependent Notes                              MicroEMACS Reference Manual
  5725.  
  5726.  
  5727.   - Under "Terminal Output definitions", set either ANSI or SMG to "1"
  5728.   and all others to "0". As stated previously, only ANSI supports the
  5729.   mouse at this time.
  5730.  
  5731.   - Under "Configuration options", you may select as you wish, with the
  5732.   following notes:
  5733.  
  5734.       - COLOR     support does not exist for VMS, even when using
  5735.                   color workstations.
  5736.       - MOUSE     support should be enabled if you have any VSII
  5737.                   workstations. Only supported under the ANSI driver.
  5738.       - KEYPAD    support recognises whether your keypad is already
  5739.                   in application mode or not, and puts your keypad
  5740.                   in its correct state on exit.
  5741.       - XNONOFF   automatically allows you to use control-S or
  5742.                   control-Q in MicroEMACS, by disabling the TTSYNC
  5743.                   characteristic. This option should not be set if
  5744.                   MicroEMACS might be used on DecStations or VT100s.
  5745.                   It also should not be used with slow terminals or
  5746.                   terminal emulators connected to fast terminal lines.
  5747.       - RMSIO     support should absolutely be used. This option
  5748.                   allows the writing and reading of files in VMS's
  5749.                   variable-length format, as opposed to STREAM-LF,
  5750.                   and cuts down on file writing and reading time by
  5751.                   approximately two thirds.
  5752.       - OPTMEM    support may be used on VMS versions 5.0 and higher.
  5753.                   It substitutes the C library's memory allocation
  5754.                   calls for the native VAX calls, and gives a speed
  5755.                   improvement.
  5756.  
  5757.           If  you  have  MMS,  you  can  use  the  supplied  DESCRIP.MMS to  build
  5758.   MicroEMACS.  Otherwise, the command file MEMAKE.COM  has  been  provided.  These
  5759.   files assume that you are using SMG as your terminal driver.  If  you  are using
  5760.   ANSI, then you  must  replace SMG with ANSI in the command and opt files. If you
  5761.   do not have MMS or are missing MEMAKE.COM, simply compile each module with "CC",
  5762.   and link with the command:
  5763.  
  5764.           $ LINK MESHR/OPTION/SHARE
  5765.  
  5766.           Note  that  the  executable  filename  must  end  in  "SHR" in order for
  5767.   MicroEMACS  to  be  used  as  a callable editor from MAIL or NOTES.   (Method  1
  5768.   above.)
  5769.  
  5770.           If you edit any of the Emacs sources, note that  any  global or external
  5771.   data  must be declared as "noshare" in order for the VMS callable editor support
  5772.   to  work properly. This applies to all global data used in the VMS version,  but
  5773.   not to routines or to "static "data.   The  "noshare"  declaration  is #define'd
  5774.   away on non-VMS systems. If you fail to do this,  VMS  will  not  allow  you  to
  5775.   INSTALL MicroEMACS as a sharable library.
  5776.  
  5777.  
  5778.  
  5779.  
  5780.   101   MicroEMACS Reference Manual                                           Mode Flags
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.                                      Appendix J                                     Appendix J
  5788.  
  5789.                                      Mode Flags                                     Mode Flags
  5790.  
  5791.  
  5792.           The two environment variables, $cmode and $gmode, contain  a  number the
  5793.   corresponds  to the modes set for the current buffer and the editor as a  whole.
  5794.   These  are encoded as the sum of the following numbers for each of the  possible
  5795.   modes:
  5796.  
  5797.   WRAP      1             Word wrap
  5798.   CMODE     2             C indentation and fence match
  5799.   SPELL     4             Interactive spell checking (Not Implemented Yet)
  5800.   EXACT     8             Exact matching for searches
  5801.   VIEW     16             Read-only buffer
  5802.   OVER     32             Overwrite mode
  5803.   MAGIC    64             Regular expressions in search
  5804.   CRYPT   128             Encryption mode active
  5805.   ASAVE   256             Auto-save mode
  5806.  
  5807.           So, if you wished to set  the  current  buffer to have CMODE, EXACT, and
  5808.   MAGIC on, and  all  the others off, you would add up the values for those three,
  5809.   CMODE 2  +  EXACT 8  +  MAGIC 64 = 74, and use a statement like:
  5810.  
  5811.           set $cmode 74
  5812.  
  5813.           or, use the binary or operator to combine the different modes:
  5814.  
  5815.           set $cmode &bor &bor 2 8 64
  5816.  
  5817.   Internal Flags  Internal Flags
  5818.  
  5819.           Some of the ways  EMACS  controls its internal functions can be modified
  5820.   by the value in the $gflags environment variable. Each bit in this variable will
  5821.   be used to control a different function.
  5822.  
  5823.   GFFLAG          1       If this bit is set to zero, EMACS will not
  5824.                           automatically switch to the buffer of the
  5825.                           first file after executing the startup macros.
  5826.   GFSDRAW         2       If this bit is set to one, supress redraw events.
  5827.  
  5828.   Current buffer flags  Current buffer flags
  5829.  
  5830.           The $cbflags environment variable allows the user to modify some  of the
  5831.   characteristics of the  current  buffer. The various characteristics are encoded
  5832.   as the sum of the following numbers:
  5833.  
  5834.  
  5835.  
  5836.                                                                                102   Mode Flags                                           MicroEMACS Reference Manual
  5837.  
  5838.  
  5839.   BFINVS          1       Internal invisible buffer
  5840.   BFCHG           2       Changed since last write
  5841.   BFTRUNC         4       buffer was truncated when read
  5842.   BFNAROW         8       buffer has been narrowed
  5843.  
  5844.           Only  the invisible and changed flags can be  modified  by  setting  the
  5845.   $cbflags variable. The truncated file and narrowed flags are read only.
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.  
  5885.  
  5886.  
  5887.  
  5888.  
  5889.  
  5890.  
  5891.  
  5892.   103   MicroEMACS Reference Manual                                                Index
  5893.  
  5894.  
  5895.  
  5896.  
  5897.  
  5898.  
  5899.                                           Index                                          Index
  5900.  
  5901.  
  5902.           !BREAK Directive 62                 case-word-upper 40
  5903.           !ENDM Directive 59                  change-file-name 36
  5904.           !FORCE Directive 59                 Changing Case 39
  5905.           !GOTO Directive 61                  clear-and-redraw 19
  5906.           !IF                                 CMODE mode 30
  5907.              !ELSE                            color 30
  5908.                and !ENDIF Directives          color pallette 52
  5909.                60                             command line 17
  5910.           !RETURN Directive 62                command processor 43
  5911.           !WHILE and !ENDWHILE                command.com 43
  5912.                Directives 61                  Commands unaffected by
  5913.           $cbflags 102                             numeric arguments. 85
  5914.           $debug 63                           Constants 48
  5915.           $gflags 102                         control key 1
  5916.           .emacsrc 48, 67                     control-x 1
  5917.           <NL> 13                             copy-region 11
  5918.                                               Creating a Screen 23
  5919.           A                                   Creating Windows 17          A
  5920.           A Word About Windows                CRYPT mode 31, 68
  5921.              Buffers                          cshell 43
  5922.                Screens                        cursor keys 4
  5923.                 and Modes 6                   cut 22
  5924.           add-global-mode 30                  Cut and Paste 22
  5925.           add-mode 3, 30                      cycle-screens 24
  5926.           Amiga 1000 94
  5927.           ASAVE mode 30                       D                                              D
  5928.           Atari 520/1040ST 92                 debugging 63
  5929.                                               DEC VMS operating system 96
  5930.           B                                   default string 14          B
  5931.           Backward Search 14                  Defining and Deleting a
  5932.           backward-character 3                     Region 10
  5933.           Basic cursor movement 3             delete-blank-lines 8
  5934.           BBS 68                              delete-buffer 28
  5935.           begin-macro 46                      delete-global-mode 30
  5936.           beginning-of-file 4, 7              delete-mode 30
  5937.           beginning-of-line 4                 delete-next-character 7
  5938.           bind-to-key 65                      delete-next-word 8
  5939.           buffer 4, 6, 27                     delete-previous-character 7
  5940.           Buffer Variables 55                 delete-previous-word 8
  5941.                                               Deleting a Screen 24
  5942.           C                                   Deleting Windows 18          C
  5943.           case-region-lower 40                Deletions 7
  5944.           case-word-capitalize 40             describe-bindings 66
  5945.           case-word-lower 40                  describe-key 65
  5946.  
  5947.  
  5948.                                                                                104   Index                                                MicroEMACS Reference Manual
  5949.  
  5950.  
  5951.           desk accessories 21                 IBM-PC/XT/AT and its clones
  5952.           desktop 23                               89
  5953.           detab-region 41                     Insertions 7
  5954.           Directives 59                       Interactive variables 56
  5955.           dragging 22
  5956.           Dragging around 21                  K                                              K
  5957.                                               Keys and the Keyboard 1
  5958.           E                                   kill buffer 11          E
  5959.           emacs.rc 48, 67                     kill-region 10
  5960.           encryption 31                       kill-to-end-of-line 8
  5961.           end-macro 46
  5962.           end-of-file 4                       L                                              L
  5963.           end-of-line 4                       label-function-key 91
  5964.           entab-region 41                     list-buffers 28, 30
  5965.           Entering Text 2
  5966.           Environmental Variables 50          M                                              M
  5967.           error parsing 67                    MAGIC mode 31
  5968.           EXACT mode 31                       mark 10
  5969.           Exact Searches 14                   meta key 1
  5970.           execute-buffer 48                   mode line 2, 6
  5971.           execute-file 48                     modes 3, 30
  5972.           execute-macro 46                    mouse 21, 52
  5973.           execute-program 43                  mouse cursor 21
  5974.           exit-emacs 8                        move-window-down 18
  5975.                                               move-window-up 18
  5976.           F                                   Moving a Screen 23          F
  5977.           file locking 95                     Moving around with the mouse
  5978.           fill column 34                           21
  5979.           fill-paragraph 7, 39
  5980.           filter 43                           N                                              N
  5981.           filter-buffer 43                    newline 1
  5982.           find-file 18, 27                    next-buffer 27
  5983.           Forward Search 13                   next-line 3
  5984.           forward-character 3                 next-paragraph 4
  5985.           function key window 48              next-word 3
  5986.           Functions 56                        numeric arguments 81
  5987.  
  5988.           G                                   O          G                                   O
  5989.           Getting Started 1                   open-line 7
  5990.           grow-window 19                      open-window 17
  5991.                                               OVER mode 33
  5992.           H          H
  5993.           handle-tab 41                       P                                              P
  5994.           Help File 67                        Parts and Pieces 2
  5995.           HOME environment variable 67        paste 23
  5996.           horizontal scrolling 22             PATH environment variable 67
  5997.           HP 150 91                           pipe-command 43
  5998.                                               point 10
  5999.           I                                   previous-line 3          I
  6000.           i-shell 44                          previous-paragraph 4
  6001.  
  6002.  
  6003.  
  6004.   105   MicroEMACS Reference Manual                                                Index
  6005.  
  6006.  
  6007.           previous-window 17                  special keys 1
  6008.           previous-word 3                     split-current-window 17
  6009.                                               startup files 67
  6010.           Q                                   store-procedure 48          Q
  6011.           Query-Replace 15                    suspend-emacs 44, 95
  6012.           query-replace-string 15, 33         switches 67
  6013.                                               Switching to a Screen 23
  6014.           R          R
  6015.           rebinding 65                        T                                              T
  6016.           redraw-display 19                   tab handling 41
  6017.           Reformatting Paragraphs 39          Tabs 40, 51, 53
  6018.           region 22                           termcap 95
  6019.           regular expressions 31              text window 2
  6020.           replace-string 14, 33               trim-region 41
  6021.           Repositioning within a
  6022.                Window 19                      U                                              U
  6023.           resize-window 19                    UNIX V5
  6024.           Resizing a Screen 23                   V7
  6025.           Resizing Windows 18                      and BSD4.[23] 95
  6026.           restricted mode 68                  User variables 55
  6027.           run 48
  6028.                                               V                                              V
  6029.           S                                   Variables 49          S
  6030.           save-file 4                         vertical scrolling 22
  6031.           Saving your text 4                  VIEW mode 34
  6032.           screen 6, 23
  6033.           screen resolution 53                W                                              W
  6034.           Screens 23                          window 6
  6035.           scroll-next-down 18                 windows 2, 17
  6036.           scroll-next-up 18                      Creating 17
  6037.           search-forward 13                      Deleting 18
  6038.           search-reverse 14                      Resizing 18
  6039.           Searching and Replacing 14          WRAP mode 34
  6040.           select-buffer 27                    wrap-word 34
  6041.           set 41                              Wrapping Text 39
  6042.           set-encryption-key 31               write-file 4
  6043.           set-fill-column 39                  writefile 36
  6044.           set-mark 10
  6045.           shell 43                            Y                                              Y
  6046.           shell-command 43                    yank 10
  6047.           shrink-window 19                    Yanking a Region 11
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.                                                                                106
  6061.  
  6062.  
  6063.  
  6064.  
  6065.                                       Contents                                      Contents
  6066.  
  6067.  
  6068.  
  6069.  
  6070.        Chapter 1  Basic Concepts                                            1
  6071.  
  6072.        Chapter 2  Basic Editing--Simple Insertions and Deletions            6
  6073.  
  6074.        Chapter 3  Using Regions                                            10
  6075.  
  6076.        Chapter 4  Search and Replace                                       13
  6077.  
  6078.        Chapter 5  Windows                                                  17
  6079.  
  6080.        Chapter 6  Using a Mouse                                            21
  6081.  
  6082.        Chapter 7  Buffers                                                  27
  6083.  
  6084.        Chapter 8  Modes                                                    30
  6085.  
  6086.        Chapter 9  Files                                                    36
  6087.  
  6088.        Chapter 10  Screen Formatting                                       39
  6089.  
  6090.        Chapter 11  Access to the Outside World                             43
  6091.  
  6092.        Chapter 12  Keyboard Macros                                         46
  6093.  
  6094.        Chapter 13  MicroEMACS Procedures                                   48
  6095.  
  6096.        Chapter 14  Debugging MicroEMACS Procedures                         63
  6097.  
  6098.        Chapter 15  Key Bindings, What they are and why                     65
  6099.  
  6100.        Appendix A  MicroEMACS Command Line Switches and Startup Files      67
  6101.  
  6102.        Appendix B  Command Completion                                      69
  6103.  
  6104.        Appendix C  MicroEMACS Commands                                     70
  6105.  
  6106.        Appendix D  MicroEMACS Bindings                                     78
  6107.  
  6108.        Appendix E  Numeric Arguments                                       80
  6109.  
  6110.        Appendix F  Numeric Arguments to Commands                           81
  6111.  
  6112.        Appendix G  Supported machines                                      86
  6113.  
  6114.  
  6115.  
  6116.                                           i
  6117.  
  6118.  
  6119.        Appendix H  Function Keys                                           88
  6120.  
  6121.        Appendix I  Machine Dependent Notes                                 89
  6122.  
  6123.        Appendix J  Mode Flags                                             102
  6124.  
  6125.        Index                                                              104
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.  
  6146.  
  6147.  
  6148.  
  6149.  
  6150.  
  6151.  
  6152.  
  6153.  
  6154.  
  6155.  
  6156.  
  6157.  
  6158.  
  6159.  
  6160.  
  6161.  
  6162.  
  6163.  
  6164.  
  6165.  
  6166.  
  6167.  
  6168.  
  6169.  
  6170.  
  6171.  
  6172.                                          ii